Hi,
In my app, I’ve got a Page model and in my routes.rb have the line:
map.resources :pages
This gives me all of the nice urls for all of the CRUD actions.
However, for showing pages, I didn’t like the urls pages/5 wasn’t very
descriptive. I preferered ‘nice’ urls such as blog/about-me. I could
use the to_params method to specify using permalinks instead, but you
still had to put pages/ in front of the permalink and I couldn’t find
a way to avoid having the model name at the start of urls.
I’ve come up with a route that solves this problem and people can
access the pages using this ‘nice’ notation and I can generate it
using the helper nice_page_path(@page).
But since I don’t actually use the page_path(@page) helper it would be
nice if I could use this to generate my ‘nice’ paths instead of having
a custom helper called nice_page_path. Is there an option you can pass
to map.resources to say that you don’t want one of the routes? Or is
there a way of overriding this helper so I can use it for my paths
instead?
thanks,
DAZ