Hi,
I have a question regarding the best way to do the following:
Given I have a Parent model that has many Child models, and the "show" page for the parent model allows the user to create a new Child, which is preferable?
A) <% form_for(@child, :parent_id => @parent.id) do |f| %> f.text_field :foo f.text_field :bar <% end %>
-- OR --
B) <% form_for(@child) do |f| %> f.hidden_field :parent_id, :value => @parent.id f.text_field :foo f.text_field :bar <% end %>
AFAIK both ways accomplish the same thing, I'm just wondering if there was a preferred "Rails" way.
Thanks, Bob