I've got a fairly simple nested form using formtastic.
My models are
class FieldMap < ActiveRecord::Base has_many :merge_splits accepts_nested_attributes_for :merge_splits class MergeSplit < ActiveRecord::Base belongs_to :field_map end
view is
<%= semantic_form_for @field_map do |f| %> <%= f.input :base_field, :collection => @base_fields %> <%= f.input :master_field, :collection =>@master_fields %> <%= f.semantic_fields_for :merge_split do |ms| %> <%= ms.input :action, :collection => @actions, :required=> false, :input_html=>{:class=>'split_merge_type', :name=>"field_map[merge_splits_attributes][action]"} %> <%= ms.input :character, :required=> false, :input_html=>{:class=>'split_merge_char', :name=>"field_map[merge_splits_attributes][character]"} %> <%= ms.input :count, :collection => [0,1], :include_blank=>false, :required=> false, :input_html=>{:class=>'split_merge_count', :name=>"field_map[merge_splits_attributes][count]"} %> <% end %> <%= f.submit %> <% end %>
When I submit my form, the parameters are
{"utf8"=>"?", "authenticity_token"=>"lNinAw4DpjkIHsuUEaa0xo+sRG+qk3elA4T2VfCWgXc=", "field_map"=>{"base_field_id"=>"18", "master_field_id"=>"11", "merge_splits_attributes"=>{"action"=>"0", "character"=>"ti", "count"=>"0"}, "attribute_map_attributes"=>{"attribute_id"=>""}}, "commit"=>"Create Field map"}
which returns a can't convert symbol to integer error. Unfortunately, It doesn't tell me what it is trying to convert.