Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 4701

Show
Ignore:
Timestamp:
08/07/06 06:18:33 (2 years ago)
Author:
marcel
Message:

Update documentation for erb trim syntax. #5651 [matt@mattmargolis.net] Merge doc patches with stable.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/stable/actionpack/CHANGELOG

    r4695 r4701  
     1*1.12.3* (June 28th, 2006) 
     2======= 
     3 
     4* Update documentation for erb trim syntax. #5651 [matt@mattmargolis.net] 
     5 
    16* Short documentation to mention use of Mime::Type.register. #5710 [choonkeat@gmail.com] 
    27 
    3 *1.12.3* (June 28th, 2006) 
     8* Pass :id => nil or :class => nil to error_messages_for to supress that html attribute. #3586 [olivier_ansaldi@yahoo.com, sebastien@goetzilla.info] 
    49 
    510* Fix broken traverse_to_controller. We now: 
  • branches/stable/actionpack/lib/action_view/base.rb

    r4189 r4701  
    1212  # = ERb 
    1313  #  
    14   # You trigger ERb by using embeddings such as <% %> and <%= %>. The difference is whether you want output or not. Consider the  
     14  # You trigger ERb by using embeddings such as <% %>, <% -%>, and <%= %>. The <%= %> tag set is used when you want output. Consider the  
    1515  # following loop for names: 
    1616  # 
     
    2020  #   <% end %> 
    2121  # 
    22   # The loop is setup in regular embedding tags (<% %>) and the name is written using the output embedding tag (<%= %>). Note that this 
     22  # The loop is setup in regular embedding tags <% %> and the name is written using the output embedding tag <%= %>. Note that this 
    2323  # is not just a usage suggestion. Regular output functions like print or puts won't work with ERb templates. So this would be wrong: 
    2424  # 
    2525  #   Hi, Mr. <% puts "Frodo" %> 
    2626  # 
    27   # (If you absolutely must write from within a function, you can use the TextHelper#concat) 
     27  # If you absolutely must write from within a function, you can use the TextHelper#concat 
     28  # 
     29  # <%- and -%> suppress leading and trailing whitespace, including the trailing newline, and can be used interchangeably with <% and %>. 
    2830  # 
    2931  # == Using sub templates