I’ve looked around for a while now, but I’m not sure how best to describe my request to google, so thought I’d ask here 😉
In rails, I know that when you nest restful routes, you generally get something like:
If you want something more meaningful, you can use slugs or friendly_id to get something like
http://localhost/categories/all-your-needs/articles/rock-out-with-this-article
(assuming you have unique names).
My question is, how can I remove the controller from the url rewriter so you get something like:
Is this possible?
Yes it is. You can use something like this:
Rails 2:
Edit:
Ok. Here you have the urls for the other REST actions:
For update add
:conditions => { :method => :post }to the previous one.For delete, use the first one with
:conditions => { :method => :delete }.For new and create, you can use:
and for create the same but with
:conditions => { :method => :post }. I hope I’ve been able to help you!