Quantcast
Channel: Custom urls and paths in rails - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Custom urls and paths in rails

$
0
0

I have two models: Books and pages in a typical one_to_many relationship.

How can I make the following

page_path(@page)

output this path:

bookname/page/pageid

instead of

page/pageid

If I override the to_param, all I can do is make a path like localhost/page/bookid/pageid but that's not what I want.


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images