Displaying 1 result from an estimated 1 matches for "ocourse".
Did you mean:
course
2006 May 26
4
shouldn''t this work? - session[:array_of_objects].delete_if {|x| x.id == params[:id]}
...ion as session[:course_list]. This is the cart for a registration
controller.
If a student chooses to delete the course from the list I get the :id
as params[:id].
However if I do
session[:course_list].delete_if {|x| x.id ==params[:id]}
does not work.
session[:course_list].delete_at(idx)
works. Ocourse to do this I have to index the list in the view and
insert the value into each link_to.
When I try this in irb the second statement works but the first does
not and does not give any error messages.
What am I missing here? I have stared at this long enough and can''t
figure it out.
TIA,...