I know there has to be a way to do this. Is there any way to edit a
model, and its has_many children in a single view?
Example:
class Metadata
has_many :metadata_entries
end
If both Metadata and MetadataEntries have a ‘label’ attribute, what
would the view look like?
Here is my best guess, but this doesn’t work:
------edit.html.erb----
<% form_for(@metadata) do |f| %>
<%= f.text_field :label %>
try to marshal the data for each "metadata_entry" has_many relationship
<% @metadata.metadata_entries.each_with_index do |entry, index| %>this is obviously wrong, how do I index this??
<% end %> <%= f.submit 'Update' %> <% end %>------end edit.html.erb----
I’m running ruby 1.8.6/Rails 2.3.2.
Thanks in advance for any and all pointers.