Here's the methods in the controller:
def empty_cart session[:cart] = nil @cart = find_cart redirect_to_index unless request.xhr? end private def redirect_to_index(msg = nil) flash[:notice] = msg redirect_to :action => 'index' end
Here's the button:
<% form_remote_tag :url => { :action => :empty_cart } do %>
<%= submit_tag "Empty cart" %>
<% end %>
And the blind_up javascript:
page[:cart].visual_effect :blind_up
Could you please tell me why the redirect_to_index method doesn't work.
Thank you!

New Topic/Question
Reply



MultiQuote


|