开发者

Set an instance variable in my controller from the view

开发者 https://www.devze.com 2023-03-31 19:28 出处:网络
I have an instance variable called @chosen_athlete in my controller. I use this variable to perform some 开发者_如何学Gocalculations in the corresponding view. However the value of the @chosen_athlete

I have an instance variable called @chosen_athlete in my controller. I use this variable to perform some 开发者_如何学Gocalculations in the corresponding view. However the value of the @chosen_athlete variable should be settable by my currently logged in user. What is the proper way to set the @chosen_athlete variable and update the data in my view?


You should use a form

Take a look there : http://guides.rubyonrails.org/form_helpers.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号