Forum: Ruby on Rails routing method problem

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Chaoran Y. (Guest)
on 2009-04-14 12:58
I have two named routes:
map.edit_setting 'setting/:key', :controller => 'settings', :action =>
'edit', :method => :get
map.update_setting 'setting/:key', :controller => 'settings', :action =>
: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?
This topic is locked and can not be replied to.