Not sure how its possible to get this error :
AbstractController::DoubleRenderError users#create
When in my controller I got this code :
I suppose redirect_to signup_path is returning either nil or false, thus your and return is not being executed.
You can fix this many ways, the simplest is replace
redirect_to signup_path and return
by
redirect_to signup_path
return
Yet, I suggest you to do a bigger change. Try changing this
if @profile.nil? || current_user.nil? || @profile.user.nil?
sign_out
redirect_to signup_path and return
end
if @profile.new_record?
render 'new' and return
else
redirect_to more_questions_path and return
end
By
if @profile.nil? || current_user.nil? || @profile.user.nil?
sign_out
redirect_to signup_path
elsif @profile.new_record?
render 'new'
else
redirect_to more_questions_path
end
This way it is clear that only one path can be taken, without relying on return.