Customizing one route in Rails 3 resources function
-
10-10-2019 - |
Question
By default the resources command generates the url for new
action as {model}/new
. Sending a path_names = {}
hash doesn't change the base {model}
according to the documentation. How would I go about routing /submit
to posts#new
action?
Solution
match 'submit' => 'posts#new'
I hope this is what you are looking for...
You might want to have a look at those two awesome screencasts by Ryan Bates if you wish to understand how it works behind the scene.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow