Jonathan
2009-Sep-15 00:11 UTC
Error "undefined method ''stringify_keys'' for "tag1":String" on multi-model form submission
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 %>
<p>
<%= f.label :name %><br />
<%= f.text_field :name %>
</p>
<p>
<%= f.label :title %><br />
<%= f.text_field :title %>
</p>
<p>
<%= f.label :content %><br />
<%= f.text_area :content %>
</p>
<h2>Tags</h2>
<% f.fields_for :tags_attributes do |tag_form| %>
<p>
<%= tag_form.label :name, ''Tag:'' %>
<%= tag_form.text_field :name %>
</p>
<% unless tag_form.object.nil? || tag_form.object.new_record? %>
<p>
<%= tag_form.label :_delete, ''Remove:'' %>
<%= tag_form.check_box :_delete %>
</p>
<% end %>
<% end %>
<p>
<%= f.submit ''Update'' %>
</p>
<p>
This was rendered by a partial view!
</p>
<% end %>
I''m still a beginner, so I hope this question isn''t too dumb,
but I''m
scratching my head here - any help?