The input form has been created in the active_admin
:
<%= semantic_nested_form_for @item, :url => admin_items_path do |f| %> <fieldset class="inputs"> <ol> <%= f.input :category %></br> <%= f.input :title %> <%= f.input :photo1 %> <%= f.input :photo2 %> </ol> </fieldset> <%= f.fields_for :ItemColors do |i| %> <fieldset class="inputs"> <ol> <%= i.input :DetailColor %> <%= i.input :size, :input_html => { :size => "10" } %> <%= i.link_to_remove "remove" %> </ol> </fieldset> <% end %> <%= f.link_to_add "add", :ItemColors %> <%= f.actions %> <% end %>
When you create a new Item
everything normally creates and sends to the page of the created Item
, but if you make an update
existing one, the routes
error occurs, although this path exists:
No route matches [PUT] "/admin/items"
If you change the first line of the partial to:
<%= semantic_nested_form_for @item, :url => admin_items_path(@item) do |f| %>
It turns out:
No route matches [PUT] "/admin/items.150" #или другой item_id
rake routes:
batch_action_admin_items POST /admin/items/batch_action(.:format) admin/items#batch_action admin_items GET /admin/items(.:format) admin/items#index POST /admin/items(.:format) admin/items#create new_admin_item GET /admin/items/new(.:format) admin/items#new edit_admin_item GET /admin/items/:id/edit(.:format) admin/items#edit admin_item GET /admin/items/:id(.:format) admin/items#show PUT /admin/items/:id(.:format) admin/items#update DELETE /admin/items/:id(.:format) admin/items#destroy
Tell me, what could this be?
UPD
It is not clear where the point in the request address is taken from.
rake routes
issues. Otherwise, you can read the tea leaves. - Vladimir Gordeev