Can't load params[:id]

really tricky problem. narrowed down the issue.

view code:

<%= button_to "Empty cart",     {:controller => 'registration',:action => :empty_cart, :id => @location_id}, :class => 'button' %>

generates html code (so @location_id is populating):

<form method="post" action="/registration/empty_cart/1" class="button-to"><div><input class="button" type="submit" value="Empty cart" /><input name="authenticity_token" type="hidden" value="3194044759df4367717129b1846c231e38195954" /></div></form>

and thus produces in the action in the registrations controller:

params[:id] = nil

in my block:

    def empty_cart         session[:cart] = nil redirect_to_index(nil,params[:id])     end

This works intermittently. I have no idea what is going on here. below is routes.rb