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

Changeset 862

Show
Ignore:
Timestamp:
03/06/05 17:27:11 (4 years ago)
Author:
david
Message:

Added shortcut :id assignment to render_component and friends (before you had to go through :params) #784 [Lucas Carlson]

Files:

Legend:

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

    r855 r862  
    11*SVN* 
     2 
     3* Added shortcut :id assignment to render_component and friends (before you had to go through :params) #784 [Lucas Carlson] 
    24 
    35* Fixed that map.connect should convert arguments to strings #780 [Nicholas Seckar] 
  • trunk/actionpack/lib/action_controller/components.rb

    r780 r862  
    77  #     def delegate_action 
    88  #       do_other_stuff_before_hello_world 
    9   #       render_component :controller => "greeter",  :action => "hello_world" 
     9  #       render_component :controller => "greeter",  :action => "hello_world", :params => { "person" => "david" } 
    1010  #     end 
    1111  #   end 
     
    1313  #   class GreeterController < ActionController::Base 
    1414  #     def hello_world 
    15   #       render_text "Hello World!" 
     15  #       render_text "#{@params['person']} says, Hello World!" 
    1616  #     end 
    1717  #   end 
     
    5555        request_for_component.send( 
    5656          :instance_variable_set, :@parameters,  
    57           (options[:params] || {}).merge({ "controller" => options[:controller], "action" => options[:action] }) 
     57          (options[:params] || {}).merge({ "controller" => options[:controller], "action" => options[:action], "id" => options[:id] }) 
    5858        ) 
    5959        return request_for_component