开发者

Customizing one route in Rails 3 resources function

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜