Displaying 2 results from an estimated 2 matches for "class_list".
2008 Sep 22
2
Variables visible in all actions in a controller
...mits 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
def set_class_id
@currentClassid = session[:currentclassid]
if !params[:class_list].nil?
if !params[:class_list][:class_id].nil?
@currentClassid = params[:class_list][:class_id]
end
end
end
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 (...
2006 May 10
4
using partials in a for loop
...9;'m trying to write a partial for a link_to_remote that i''m using over
and over again, but simply moving the code to a partial doesn''t seem to
work.
Here is how I have it set up:
class_planner.rhtml:
<% for course in @courses %>
<%= render :partial => "class_list" %>
<% end %>
_class_list.rhtml:
<li>
<%= link_to_remote "#{course.title}",
{:url => {:action => "add_course", :id => course}},
:class => "course", :name => "#{course.title}"
%>
</li>
The mai...