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
act开发者_StackOverflow中文版ion?
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.
routing-walkthrough routing-walkthrough-part-2
精彩评论