the difference between render
and redirect
is, redirect loads your redirected action but render doesn't,
Ex:
def new
@user = User.new
end
def create
if <some conditions>
redirect_to 'new'
else
render 'new'
end
end
so when you call render
, it doesnt create User.new
, only redirect will. So probably you are rendering an action which loads something from config
.
So the solutions would be
def new
@user = User.new
end
def create
if <some conditions>
redirect_to 'new'
else
@user = User.new
render 'new'
end
end
I hope u get the idea. and if you could post the spec
someone might be able to help easier ..