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

Changeset 2446

Show
Ignore:
Timestamp:
10/03/05 21:20:52 (3 years ago)
Author:
david
Message:

Made the documentation about render template/file sane

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/base.rb

    r2433 r2446  
    504504      # <tt>render_partial_collection(partial_name, collection, partial_spacer_template = nil, local_assigns = {})</tt>. 
    505505      # 
     506      # === Rendering a template 
     507      #  
     508      # Template rendering works just like action rendering except that it takes a path relative to the template root.  
     509      # The current layout is automatically applied. 
     510      # 
     511      #   # Renders the template located in [TEMPLATE_ROOT]/weblog/show.r(html|xml) (in Rails, app/views/weblog/show.rhtml) 
     512      #   render :template => "weblog/show" 
     513      # 
    506514      # === Rendering a file 
    507515      #  
    508       # File rendering works just like action rendering except that it takes a path relative to the template root or an absolute 
    509       # path if use_full_path is passed as true. The current layout is not applied automatically. 
    510       # 
    511       #   # Renders the template located in [TEMPLATE_ROOT]/weblog/show.r(html|xml) (in Rails, app/views/weblog/show.rhtml) 
    512       #   render :file => "weblog/show" 
     516      # File rendering works just like action rendering except that it takes an absolute path.  
     517      # The current layout is not applied automatically. 
    513518      # 
    514519      #   # Renders the template located in /path/to/some/template.r(html|xml) 
    515       #   render :file => "/path/to/some/template", :use_full_path => false 
     520      #   render :file => "/path/to/some/template" 
    516521      # 
    517522      #   # Renders the same template within the current layout, but with a 404 status code 
    518       #   render :file => "/path/to/some/template", :use_full_path => false, :layout => true, :status => 404 
     523      #   render :file => "/path/to/some/template", :layout => true, :status => 404 
    519524      # 
    520525      # _Deprecation_ _notice_: This used to have the signature <tt>render_file(path, status = 200)</tt>