I have a model called Setting, and I want to be able to edit and update
multiple settings at once. Therefore I added this resource to routes.rb:
map.resources :settings, :collection => {:edit => :get, :update =>
:put}
As you can see I want to edit and update _collections_ of settings, not
just a single Setting at a time.
When I run "rake routes" I get the following routes as expected:
...
update_settings PUT /settings/update {:controller=>"settings",
:action=>"upda
te", :id=>/[^\/.?]+/}
...
edit_settings GET /settings/edit {:controller=>"settings",
:action=>"edit", :id=>/[^\/.?]+/}
...
But as you can see, both the edit and update actions still require me to
set an id! But since I''m updating multiple settings, that''s
not
possible.
This (I''m using HAML):
- form_tag update_settings_path, :method => "put" do
generates this error:
update_settings_url failed to generate from {:action=>"update",
:controller=>"settings"}, expected: {:id=>/[^\/.?]+/,
:action=>"update",
:controller=>"settings"}, diff: {:id=>/[^\/.?]+/}
How can I solve this? I am not so much into regular expressions, but
it''s just requiring a number, right?
If none of you have a suggestion, I''ll post a ticket to Rails''
lighthouse.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---