Changeset 786

Show
Ignore:
Timestamp:
10/28/07 21:35:29 (1 year ago)
Author:
has.s..@gmail.com
Message:

Updated docs for render regarding clean_context issues. Also added the ability for render to call an object with options

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/merb/mixins/render.rb

    r785 r786  
    123123    #  in object if such a method exists for the current content_type   
    124124    #  
     125    # When using multiple calls to render in one action, the context of the render is cached for performance reasons 
     126    # That is, all instance variables are loaded into the view_context object only on the first call and then this is re-used. 
     127    # What this means is that in the case where you may want to render then set some more instance variables and then call render again 
     128    # you will want to use a clean context object.  To do this 
     129    # 
     130    # render :clean_context => true 
     131    # 
     132    # This will ensure that all instance variable are up to date in your views. 
    125133    # 
    126134    def render(*args,&blk) 
     
    137145      if obj = args.first 
    138146        # Check for a template 
    139         unless find_template(:action => action
     147        unless find_template({:action => action}.merge(opts)
    140148          fmt = content_type 
    141149          if transform_method = Merb.mime_transform_method(fmt)