Flash
Having read up on this question about redirecting with flash, it seems that using redirect_to
does not maintain the flash
keys you set in your controller
To fix this, you can use flash.keep
:
def update
...
else
flash.keep #-> added
...
redirect to '/users/edit'
end
end
System
Your system looks very inefficient to me - I know you've duplicated the file devise uses, but it's still bloated.
Also you're using puts
in your controller? No! You should only output data in your views
!