Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ApplicationController
- private
- def is_admin?
- unless current_user.admin?
- flash[:notice] = "You are not allowed here."
- redirect_back_or_default root_path
- end
- end
- class BlogsController < ApplicationController
- before_filter :is_admin?, :except => [:index, :show]
- # the opposite to except is only.
- end
Add Comment
Please, Sign In to add comment