I'm making a banner system where I can upload a banner to a CampaignBanner ( with description, url and position ).
In the view I build the form like this :
.page-header
%h1= t(:'.market_place.title')
.row-fluid
= form_tag update_dashboard_banners_admin_dashboard_index_path, :method => :put do
%fieldset
- @dashboard_banners.each do |dashboard_banner|
.span3
= simple_fields_for "dashboard_banners[]", dashboard_banner do |db|
= db.input :description
= db.input :target
= db.input :target_url
- dashboard_banner.build_banner if dashboard_banner.banner.nil?
= db.fields_for :banner do |f|
= f.input :data, :as => :file
%p= submit_tag t(:'buttons.update'), :class => 'btn btn-primary'
But when I submit the form I got
expected Array (got Rack::Utils::KeySpaceConstrainedParams) for param dashboard_banners
For example in my first fields_for I get in name for target_url :
dashboard_banners[21][target_url]
There I have my id but in the second fields for my banner I have :
dashboard_banners[][banner_attributes][data]
Here you can see that I don't have the number 21 anymore.
Is this linked to the internal server I got?