From 1dc4cc030ffecb57ceffecac81215ed1d7924f3f Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 9 Jul 2006 05:17:41 +0000 Subject: Update documentation for erb trim syntax. Closes #5651. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4598 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/CHANGELOG | 2 ++ actionpack/lib/action_view/base.rb | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'actionpack') diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 68a02b01e5..74bf955e92 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Update documentation for erb trim syntax. #5651 [matt@mattmargolis.net] + * Pass :id => nil or :class => nil to error_messages_for to supress that html attribute. #3586 [olivier_ansaldi@yahoo.com, sebastien@goetzilla.info] * Reset @html_document between requests so assert_tag works. #4810 [jarkko@jlaine.net, easleydp@gmail.com] 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: # # Names of all the people @@ -19,12 +19,14 @@ module ActionView #:nodoc: # Name: <%= person.name %>
# <% 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 # -- cgit v1.2.3