I want make a variable visible to all actions in a controller. Everytime user submits a parameter “school_class_id” on the basis of which I assign a variable which I want to make available to all the actions in controller.
I used before_filter: set_class_id where set_class_id is defined as
@currentClassid = session[:currentclassid]
@currentClassid = params[:class_list][:class_id]
In this case, value of @currentClassid changes in index action. However in other actions, it remains the same as the value it is assigned intially for the first time ( In this case , the value in the session ). I am clueless why this is happening. If in index action, the value of @currentClassid is changing, then why not in other actions?