aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-07-09 05:17:41 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-07-09 05:17:41 +0000
commit1dc4cc030ffecb57ceffecac81215ed1d7924f3f (patch)
treec5f6cf5df5797e23572ea8cf314a6da2a3649322 /actionpack/lib/action_view
parente34de4dc24fbfad3a80a063b0127242c83e485a3 (diff)
downloadrails-1dc4cc030ffecb57ceffecac81215ed1d7924f3f.tar.gz
rails-1dc4cc030ffecb57ceffecac81215ed1d7924f3f.tar.bz2
rails-1dc4cc030ffecb57ceffecac81215ed1d7924f3f.zip
Update documentation for erb trim syntax. Closes #5651.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4598 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/base.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb
index 87b0174703..13b2ef4821 100644
--- a/actionpack/lib/action_view/base.rb
+++ b/actionpack/lib/action_view/base.rb
@@ -11,7 +11,7 @@ module ActionView #:nodoc:
#
# = ERb
#
- # You trigger ERb by using embeddings such as <% %> and <%= %>. The difference is whether you want output or not. Consider the
+ # You trigger ERb by using embeddings such as <% %>, <% -%>, and <%= %>. The <%= %> tag set is used when you want output. Consider the
# following loop for names:
#
# <b>Names of all the people</b>
@@ -19,12 +19,14 @@ module ActionView #:nodoc:
# Name: <%= person.name %><br/>
# <% end %>
#
- # The loop is setup in regular embedding tags (<% %>) and the name is written using the output embedding tag (<%= %>). Note that this
+ # The loop is setup in regular embedding tags <% %> and the name is written using the output embedding tag <%= %>. Note that this
# is not just a usage suggestion. Regular output functions like print or puts won't work with ERb templates. So this would be wrong:
#
# Hi, Mr. <% puts "Frodo" %>
#
- # (If you absolutely must write from within a function, you can use the TextHelper#concat)
+ # If you absolutely must write from within a function, you can use the TextHelper#concat
+ #
+ # <%- and -%> suppress leading and trailing whitespace, including the trailing newline, and can be used interchangeably with <% and %>.
#
# == Using sub templates
#