devise 1.2 rails 3.0.5
I have this in my controller: before_filter :authenticate_user!
When a form is submitted, i'm redirected to the log in page and the user is automatically logged out. Even though they have logged in, this seems to be happening on form post. This is the action that has the issue:
def next
myObject = theObject.first
myObject.current_number = params[:next_number]
myObject.save!
redirect_to :action => 'index'
end
In my view:
%form{:method => "post"}
%input#nextNumber{:name => "next_number", :type => "hidden", :value => "7"}/
Triggered in js as follows:
$("form").submit();
Any ideas why this would be happening? Can't find any useful info...