Forum: Ruby on Rails routing method problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
24429774a7859c9283caf73d3b1cb8aa?d=identicon&s=25 Chaoran Yang (jackyang)
on 2009-04-14 14:52
(Received via mailing list)
I have two named routes:
map.edit_setting 'setting/:key', :controller => 'settings', :action =>
'edit', :method => :get
map.update_setting 'setting/:key', :controller => 'settings', :action
=>
'update',
:method => :put

And I have to link_to_remote links:
link_to_remote "Edit", :url => edit_setting_path
(@setting.key), :method
=> :get
link_to_remote "Save", :url => update_setting_path(@setting.key),
:method => :put

But both link will trigger the :edit action. It seems Rails ignores
the
:method parameter when routing.

How can I map the same url with different method to different
actions?
Thanks!
This topic is locked and can not be replied to.