Not sure how its possible to get this error :
AbstractController::DoubleRenderError users#create
When in my controller I got this code :
Give this a try:
class UsersController < ApplicationController
before_filter :signed_in_user
def create
return back_button if params[:back_button]
@profile = current_user.build_profile(params[:user])
if @profile.nil? || current_user.nil? || @profile.user.nil?
sign_out
return redirect_to signup_path
end
if @profile.new_record?
render 'new'
else
redirect_to more_questions_path
end
end
private
def signed_in_user
unless signed_in?
store_location
return redirect_to signin_url, notice: "Please sign in."
end
end
end
The reasoning behind it: x and return
means x and return nil
, thus returns nil
. Actually, you try to short-circuit the controller action, and return redirect_to ...
.