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 require_login
      unless logged_in?
        flash[:error] = "You must be logged in to access this section"
        redirect_to root_url 
      end
    end
def require_login unless logged_in? flash [ :error ] = "You must be logged in to access this section" redirect_to root_url end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .
# halts request cycle