开发者

Customizing one route in Rails 3 resources function

开发者 https://www.devze.com 2023-01-25 06:05 出处:网络
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 r

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

0

精彩评论

暂无评论...
验证码 换一张
取 消