I have an object elem that I'd like to pass to the remove_tag_from_cart method. Here is my attempt:
-counter.times do |c|
-elem = @tags[c]
#{elem.name}#{link_to_remote image_tag('x.png'), :url => {:controller => 'questions', :action => 'remove_tag_from_cart'}, :with => {:tag_to_remove => :elem}}
The :with
clause isn't working correctly. The image does not even show up. If I take out the :with
clause, then the link properly shows up and calls the method correctly, but I need the elem
object in order to remove it from the cart
.
Suggestions?