Paste
Pasted as Ruby by registered user omemunama ( 10 years ago )
class CompaniesController < ApplicationController
before_filter :authenticate_user!, except: [:index, :show]
before_action :only_admins, except: [:index, :show]
def only_admins
redirect_to companies_path, :alert => 'Only admin' unless current_user.admin
end
end
Revise this Paste