jktress
jktress

Reputation: 1097

Set an instance variable in my controller from the view

I have an instance variable called @chosen_athlete in my controller. I use this variable to perform some calculations 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?

Upvotes: 1

Views: 341

Answers (1)

Intrepidd
Intrepidd

Reputation: 20948

You should use a form

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

Upvotes: 2

Related Questions