title: Ruby on rails binding form to an object
body: <p>In this guide:</p>
  
  <p><a href="http://guides.rubyonrails.org/v2.3.11/form_helpers.html#binding-a-form-to-an-object" rel="nofollow">http://guides.rubyonrails.org/v2.3.11/form_helpers.html#binding-a-form-to-an-object</a></p>
  
  <p>In the section <code>2.2 Binding a Form to an Object</code> I saw that this:</p>
  
  <pre><code>&lt;% form_for :article, @article, :url =&gt; { :action =&gt; "create" }, :html =&gt; {:class =&gt; "nifty_form"} do |f| %&gt;
    &lt;%= f.text_field :title %&gt;
    &lt;%= f.text_area :body, :size =&gt; "60x12" %&gt;
    &lt;%= submit_tag "Create" %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>I get form like this :</p>
  
  <pre><code>&lt;form action="/articles/create" method="post" class="nifty_form"&gt;
    &lt;input id="article_title" name="article[title]" size="30" type="text" /&gt;
    &lt;textarea id="article_body" name="article[body]" cols="60" rows="12"&gt;&lt;/textarea&gt;
    &lt;input name="commit" type="submit" value="Create" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>So the controller method <code>create</code> should be executed and @action should be serialized from form to it. So do I need to declare create with some parameters like :</p>
  
  <pre><code>def create(action)
  action.save!
  end
  </code></pre>
  
  <p>Or how would I get hold of action object which I sent from form in controller method create</p>