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

Changeset 3015

Show
Ignore:
Timestamp:
11/14/05 00:12:46 (3 years ago)
Author:
bitsweat
Message:

Update documentation for render :file. References #2858.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r3007 r3015  
    11*SVN* 
     2 
     3* Update documentation for render :file.  #2858 [Tom Werner] 
    24 
    35* Only include builtin filters whose filenames match /^[a-z][a-z_]*_helper.rb$/ to avoid including operating system metadata such as ._foo_helper.rb.  #2855 [court3nay@gmail.com] 
  • trunk/actionpack/lib/action_controller/base.rb

    r2944 r3015  
    461461 
    462462    protected 
    463       # Renders the content that'll be returned to the browser as the response body. This can just be as regular text, but is 
    464       # more often the compilation of a template. 
     463      # Renders the content that will be returned to the browser as the response body. 
    465464      # 
    466465      # === Rendering an action 
     
    522521      # === Rendering a file 
    523522      #  
    524       # File rendering works just like action rendering except that it takes an absolute path.  
    525       # The current layout is not applied automatically. 
    526       # 
    527       #   # Renders the template located in /path/to/some/template.r(html|xml) 
    528       #   render :file => "/path/to/some/template" 
    529       # 
    530       #   # Renders the same template within the current layout, but with a 404 status code 
    531       #   render :file => "/path/to/some/template", :layout => true, :status => 404 
     523      # File rendering works just like action rendering except that it takes a filesystem path. By default, the path 
     524      # is assumed to be absolute, and the current layout is not applied. 
     525      # 
     526      #   # Renders the template located at the absolute filesystem path 
     527      #   render :file => "/path/to/some/template.rhtml" 
     528      #   render :file => "c:/path/to/some/template.rhtml" 
     529      # 
     530      #   # Renders a template within the current layout, and with a 404 status code 
     531      #   render :file => "/path/to/some/template.rhtml", :layout => true, :status => 404 
     532      #   render :file => "c:/path/to/some/template.rhtml", :layout => true, :status => 404 
     533      # 
     534      #   # Renders a template relative to the template root and chooses the proper file extension 
     535      #   render :file => "some/template", :use_full_path => true 
    532536      # 
    533537      # _Deprecation_ _notice_: This used to have the signature <tt>render_file(path, status = 200)</tt>