app/controllers/application_controller.rb
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def authenticate_user!
      unless current_user
        redirect_to root_url, :alert => 'You need to sign in for access to this page.'
      end
    end
def authenticate_user! unless current_user redirect_to root_url , :alert => 'You need to sign in for access to this page.' end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .