RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: bayendor
Site: http://bayendor.github.io/
Dana:
Make sure you have included the code for basic authorization in application_controller.rb
def authorize redirect_to login_url, alert: "Not authorized" if current_user.nil? end
and then make sure to invoke it in all your controllers:
class ArticlesController < ApplicationController before_filter :authorize, only: [:edit, :update] # could also use before_action in Rails 4
Dana:
Make sure you have included the code for basic authorization in application_controller.rb
and then make sure to invoke it in all your controllers: