Questions on routing

I have two questions on routing if any one has some spare time.

  1. Is there any way to declare a resource and have its routes use
    something other than :id? so that it ends up that /users/:user_name maps
    to the show action

  2. I noticed when I define a custom rout like

match ‘/passwords/:user_name/edit’

I don’t get any named paths that show up when I run rake routes

Is there any way to say something like

match ‘/passwords/:user_name/edit’, :name => :change_password

so that I can use it like

link_to change_password_path @user

Thank you every one hope all is well

On Thu, Jul 21, 2011 at 9:22 PM, Tyrel R. [email protected] wrote:

I have two questions on routing if any one has some space time.

One forum over you’ll find the Rails guys. You’ll find better (and
faster!) answers to your Rails questions there. :slight_smile:


Phillip G.

phgaw.posterous.com | twitter.com/phgaw | gplus.to/phgaw

A method of solution is perfect if we can forsee from the start,
and even prove, that following that method we shall attain our aim.
– Leibniz

match ‘/passwords/:user_name/edit’, :name => :change_password

Don’t use :name, use :as.