On Mon, Dec 8, 2008 at 1:55 PM, Dave Smith
<[EMAIL PROTECTED]> wrote:
>
> Hi Guys,
>
> I have the following route to show the articles for a selected service
> in my application.
>
> http://localhost:3000/services/4/articles
>
> I want to be able to have a route to the service name rather than the
> route such as the following.
>
> http://localhost:3000/services/clothes/articles

Assuming that the attribute of the Service is called name,
you should define this in your Service model:

def to_param
  name
end

for more info, look at this post:

http://www.jroller.com/obie/entry/seo_optimization_of_urls_in

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to