Ruby on rails 3 link_to controller and action

后端 未结 3 459
长情又很酷
长情又很酷 2020-12-30 19:24

I know this is probably a pretty simple concept. I am trying to create a link to a controller and action. For example I have a link in my layout file to update a record when

3条回答
  •  无人及你
    2020-12-30 20:02

    If you want to pass params too then do

    <%= link_to student.name,  controller: "users", action: "show", id: student.id, partial: "profile"  %> 
    

提交回复
热议问题