respond_to do |format|
if @user.save
format.js { render :nothing => true, :status => :ok, :location => @user }
else
format.js { render :json => @user.errors, :status => :unprocessable_entity }
end
end
All options I've tried (like putting respond_to :js
at the top of controller, etc) don't quite work the way as in this.
Rails 3 Format:
Use respond_to :json and respond_with(@user)