--- !ruby/object:RI::ClassDescription 
attributes: []

class_methods: []

comment: 
- !ruby/struct:SM::Flow::P 
  body: Components allow you to call other actions for their rendered response while executing another action. You can either delegate the entire response rendering or you can mix a partial response in with your other content.
- !ruby/struct:SM::Flow::VERB 
  body: "  class WeblogController &lt; ActionController::Base\n    # Performs a method and then lets hello_world output its render\n    def delegate_action\n      do_other_stuff_before_hello_world\n      render_component :controller =&gt; &quot;greeter&quot;,  :action =&gt; &quot;hello_world&quot;, :params =&gt; { :person =&gt; &quot;david&quot; }\n    end\n  end\n\n  class GreeterController &lt; ActionController::Base\n    def hello_world\n      render :text =&gt; &quot;#{params[:person]} says, Hello World!&quot;\n    end\n  end\n"
- !ruby/struct:SM::Flow::P 
  body: "The same can be done in a view to do a partial rendering:"
- !ruby/struct:SM::Flow::VERB 
  body: "  Let's see a greeting:\n  &lt;%= render_component :controller =&gt; &quot;greeter&quot;, :action =&gt; &quot;hello_world&quot; %&gt;\n"
- !ruby/struct:SM::Flow::P 
  body: "It is also possible to specify the controller as a class constant, bypassing the inflector code to compute the controller class at runtime:"
- !ruby/struct:SM::Flow::P 
  body: "&lt;%= render_component :controller =&gt; GreeterController, :action =&gt; &quot;hello_world&quot; %&gt;"
- !ruby/struct:SM::Flow::H 
  level: 2
  text: When to use components
- !ruby/struct:SM::Flow::P 
  body: Components should be used with care. They're significantly slower than simply splitting reusable parts into partials and conceptually more complicated. Don't use components as a way of separating concerns inside a single application. Instead, reserve components to those rare cases where you truly have reusable view and controller elements that can be employed across many applications at once.
- !ruby/struct:SM::Flow::P 
  body: "So to repeat: Components are a special-purpose approach that can often be replaced with better use of partials and filters."
constants: []

full_name: ActionController::Components
includes: []

instance_methods: 
- !ruby/object:RI::MethodSummary 
  name: render_component
name: Components
superclass: 
