you can use

match "/:user_name/:product_name" => "products#show"

but be sure to place this at the bottom of your routes file so it will match
if not any other routes match.
one big problem i'm seeing with this approach is if a user's name is the
same as one of your controllers.
so you have to consider that.

On Mon, Feb 14, 2011 at 2:04 PM, Mitchell Gould <[email protected]>wrote:

> I have a user. They have could have many products
>
> The typical link in rails would be
> www.somesite.com/controller/action/id
>
> what I want is it to look like
>
> www.somesite.com/user_name/product_name
>
> How can I do this using routes.rb
>
>
> Thank
>
> Mitch
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> 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.
>
>


-- 
-------------------------------------------------------------
visit my blog at http://jimlabs.heroku.com

-- 
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