You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: actionpack/lib/action_view/base.rb
+5-5
Original file line number
Diff line number
Diff line change
@@ -8,13 +8,13 @@
8
8
moduleActionView#:nodoc:
9
9
# = Action View Base
10
10
#
11
-
# Action View templates can be written in three ways. If the template file has a <tt>.erb</tt> (or <tt>.rhtml</tt>) extension then it uses a mixture of ERb
11
+
# Action View templates can be written in three ways. If the template file has a <tt>.erb</tt> (or <tt>.rhtml</tt>) extension then it uses a mixture of ERB
12
12
# (included in Ruby) and HTML. If the template file has a <tt>.builder</tt> (or <tt>.rxml</tt>) extension then Jim Weirich's Builder::XmlMarkup library is used.
13
13
# If the template file has a <tt>.rjs</tt> extension then it will use ActionView::Helpers::PrototypeHelper::JavaScriptGenerator.
14
14
#
15
-
# == ERb
15
+
# == ERB
16
16
#
17
-
# You trigger ERb by using embeddings such as <% %>, <% -%>, and <%= %>. The <%= %> tag set is used when you want output. Consider the
17
+
# You trigger ERB by using embeddings such as <% %>, <% -%>, and <%= %>. The <%= %> tag set is used when you want output. Consider the
18
18
# following loop for names:
19
19
#
20
20
# <b>Names of all the people</b>
@@ -23,7 +23,7 @@ module ActionView #:nodoc:
23
23
# <% end %>
24
24
#
25
25
# The loop is setup in regular embedding tags <% %> and the name is written using the output embedding tag <%= %>. Note that this
26
-
# is not just a usage suggestion. Regular output functions like print or puts won't work with ERb templates. So this would be wrong:
26
+
# is not just a usage suggestion. Regular output functions like print or puts won't work with ERB templates. So this would be wrong:
27
27
#
28
28
# <%# WRONG %>
29
29
# Hi, Mr. <% puts "Frodo" %>
@@ -81,7 +81,7 @@ module ActionView #:nodoc:
81
81
#
82
82
# == Builder
83
83
#
84
-
# Builder templates are a more programmatic alternative to ERb. They are especially useful for generating XML content. An XmlMarkup object
84
+
# Builder templates are a more programmatic alternative to ERB. They are especially useful for generating XML content. An XmlMarkup object
85
85
# named +xml+ is automatically made available to templates with a <tt>.builder</tt> extension.
# Returns an array of callback objects that form the before_save chain.
228
+
#
229
+
# To further check if the before_save chain contains a proc defined as <tt>rest_when_dead</tt> use the <tt>filter</tt> property of the callback object:
Copy file name to clipboardExpand all lines: railties/guides/source/action_controller_overview.textile
+3-14
Original file line number
Diff line number
Diff line change
@@ -615,26 +615,15 @@ Rails comes with two built-in HTTP authentication mechanisms:
615
615
616
616
h4. HTTP Basic Authentication
617
617
618
-
HTTP basic authentication is an authentication scheme that is supported by the majority of browsers and other HTTP clients. As an example, consider an administration section which will only be available by entering a username and a password into the browser's HTTP basic dialog window. Using the built-in authentication is quite easy and only requires you to use one method, +authenticate_or_request_with_http_basic+.
618
+
HTTP basic authentication is an authentication scheme that is supported by the majority of browsers and other HTTP clients. As an example, consider an administration section which will only be available by entering a username and a password into the browser's HTTP basic dialog window. Using the built-in authentication is quite easy and only requires you to use one method, +http_basic_authenticate_with+.
619
619
620
620
<ruby>
621
621
class AdminController < ApplicationController
622
-
USERNAME, PASSWORD = "humbaba", "5baa61e4"
623
-
624
-
before_filter :authenticate
625
-
626
-
private
627
-
628
-
def authenticate
629
-
authenticate_or_request_with_http_basic do |username, password|
With this in place, you can create namespaced controllers that inherit from +AdminController+. The before filter will thus be run for all actions in those controllers, protecting them with HTTP basic authentication.
626
+
With this in place, you can create namespaced controllers that inherit from +AdminController+. The filter will thus be run for all actions in those controllers, protecting them with HTTP basic authentication.
Copy file name to clipboardExpand all lines: railties/guides/source/api_documentation_guidelines.textile
+1-1
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Documentation has to be concise but comprehensive. Explore and document edge cas
29
29
30
30
The proper names of Rails components have a space in between the words, like "Active Support". +ActiveRecord+ is a Ruby module, whereas Active Record is an ORM. All Rails documentation should consistently refer to Rails components by their proper name, and if in your next blog post or presentation you remember this tidbit and take it into account that'd be phenomenal.
31
31
32
-
Spell names correctly: Arel, Test::Unit, RSpec, HTML, MySQL, JavaScript, ERb. When in doubt, please have a look at some authoritative source like their official documentation.
32
+
Spell names correctly: Arel, Test::Unit, RSpec, HTML, MySQL, JavaScript, ERB. When in doubt, please have a look at some authoritative source like their official documentation.
33
33
34
34
Use the article "an" for "SQL", as in "an SQL statement". Also "an SQLite database".
Copy file name to clipboardExpand all lines: railties/guides/source/command_line.textile
+1-1
Original file line number
Diff line number
Diff line change
@@ -484,7 +484,7 @@ end
484
484
We take whatever args are supplied, save them to an instance variable, and literally copying from the Rails source, implement a +manifest+ method, which calls +record+ with a block, and we:
485
485
486
486
* Check there's a *public* directory. You bet there is.
487
-
* Run the ERb template called "tutorial.erb".
487
+
* Run the ERB template called "tutorial.erb".
488
488
* Save it into "Rails.root/public/tutorial.txt".
489
489
* Pass in the arguments we saved through the +:assigns+ parameter.
0 commit comments