简体   繁体   中英

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.

尝试使用以下resources :communications, param: :username有关更多信息,请访问http://guides.rubyonrails.org/routing.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM