icn
icn

Reputation: 17876

Rails : how to change resourceful actions parameters

For standard rails resourceful actions (say communications controller )

  index
  create
  show
  update

show has parameter id

get /communications/:id

route

Is it possible I can have

   get /communications/:username 

for show action?

Thanks for any help.

Upvotes: 0

Views: 67

Answers (1)

Andrey Demidenko
Andrey Demidenko

Reputation: 200

Try this resources :communications, param: :username For more information visit http://guides.rubyonrails.org/routing.html

Upvotes: 1

Related Questions