I’m following the tutorial on
http://guides.rubyonrails.org/getting_started.html,
and got stuck on the very last section, “Building a Multi-Model Form”.
I’m trying to do two models in the same form, and I get the following
error:
undefined method `stringify_keys’ for “tag1”:String
Here is the partial view I am using:
<% form_for(@post) do |f| %>
<%= f.error_messages %>
<%= f.label :name %>
<%= f.text_field :name %>
<%= f.label :title %>
<%= f.text_field :title %>
<%= f.label :content %>
<%= f.text_area :content %>
Tags
<% f.fields_for :tags_attributes do |tag_form| %><%= tag_form.label :name, 'Tag:' %> <%= tag_form.text_field :name %>
<% unless tag_form.object.nil? || tag_form.object.new_record? %><%= tag_form.label :_delete, 'Remove:' %> <%= tag_form.check_box :_delete %>
<% end %> <% end %><%= f.submit 'Update' %>
This was rendered by a partial view!
<% end %>I’m still a beginner, so I hope this question isn’t too dumb, but I’m
scratching my head here - any help?