title: Rails 3: How to submit form inside another model's show method
body: <p>I have a page in pages#show. I created a messages form inside that page. When submitted I get this error "Routing Error No route matches [POST] /pages/9". </p>
  
  <p>So it's a form inside another's model show page. In this case it's a form that will work with the Message model, inside a Page show view.</p>
  
  <pre><code>&lt;%= form_for(@message, :url =&gt; page_path(@page)) do |f| %&gt;
  &lt;div class="field"&gt;
    &lt;%= f.label :content %&gt;&lt;br /&gt;
    &lt;%= f.text_area :content %&gt;
  &lt;/div&gt;
  &lt;div class="actions"&gt;
    &lt;%= f.submit %&gt;
  &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>