<% form_remote_for :user, @user, :url => { :action => "create" } do |f| %> . . <%= submit_tag "Add user" %>
controller: def create @user = User.new(params[:user])
if @user.save if(request.xhr?) flash[:notice] = "OK ADDED" redirect_to :action => :index else flash[:notice] = "not xhr" end end end
When I run this, it doesn't seem to pass request.xhr? so it never redirects.
What's wrong with this?