开发者

rails routing question - restful url pointing to different controller

I have a Rails 3 app with a url like this: /books/1/pages/2

I want this to actually point to the Books controller but with a pa开发者_C百科ge_id param, rather than the Pages controller with the book_id param. Is this possible?


In routes.rb: match '/books/:id/pages/:page_id' => 'books#your_action'

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜