Sha256: b9a8942aa391cfefd853f4a9e0144e21b584bde808ba481b1d4734f5105bce39
Contents?: true
Size: 862 Bytes
Versions: 9
Compression:
Stored size: 862 Bytes
Contents
# The AdminController is the parent class that makes sure all administrator actions # require a logged-in User with an admin Role. class Admin::BaseController < ApplicationController layout 'admin' # Replace this with your own authentication / authorization stuff before_filter :http_authentication # Example when using Devise gem # before_filter :authenticate_admin! # Add controller names you want to include as tab. Eg. # @@tabs = %w(messages) # if you created a Admin::MessagesController using the admin_scaffold generator. cattr_accessor :tabs @@tabs = %w() # GET /admin/ def index end private ADMIN_USERNAME = 'admin' ADMIN_PASSWORD = 'admin' def http_authentication authenticate_or_request_with_http_basic do |username, password| username == ADMIN_USERNAME && password == ADMIN_PASSWORD end end end
Version data entries
9 entries across 9 versions & 1 rubygems