When I move to page which should be accesible only for signed in user, the Devise render sign in form. I have a nice styled notification which tells user that he is signed out, and I would like to show it without redirecting to sign in page. I have file user.js.erb
which contains working Javascript code, but I don't know how to run it. I was trying to rewrite the authenticate_user
method, but without success.
def authenticate_user!
unless current_user
end
end
I've tried respond_to
with format.js
, but it hasn't worked. I don't need ready code, but I would really appreciate if anyone can direct me in the right direction.