Created
July 23, 2008 03:50
-
-
Save carllerche/1516 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Router.prepare do |r| | |
r.match(:controller => "users") do | |
r.match("/users/:id", :method => :get).to(:action => "show") | |
r.match("/users/:id", :method => :put).to(:action => "update") | |
end | |
end | |
# Both routes generate the exact same path, so do we just | |
# require the minimum necessary to differentiate them? | |
Router.generate(:id => 10, :method => :get) | |
Router.generate(:id => 10, :action => :update) | |
Router.generate(:controller => "users", :action => "show", :id => 10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment