I take inputs from users
In my index action i have:
@b = Ece.find_by_code("#{params[:course]}")
I want to use the value stored in @b in my show action as well as in index action.
In my show action i want to do something like this:
<p><%= link_to "Forum", href="/courses/#{Course.find_by_courseCode(<%= @b %>).id}", :class=>"question_button round" %>
How can i setup @b to be global so that both these actions can use it
Note: Ece and Course are two different models
I just wanted to use a way to declare @b to be global.
and using $b instead of @b does the trick