Sha256: f4281c13a1b1a2142b73fb92e63469fa227057bb4a2e1dbbb129a8a8ca203663
Contents?: true
Size: 820 Bytes
Versions: 16
Compression:
Stored size: 820 Bytes
Contents
module Gaku module Admin class BaseController < CoreController self.responder = Gaku::AppResponder respond_to :html layout :resolve_layout before_filter :authorize_admin private def current_ability @current_ability ||= Gaku::AdminAbility.new(current_user) end def resolve_layout case action_name when 'index' 'gaku/layouts/admin/index' when 'show' 'gaku/layouts/admin/show' else 'gaku/layouts/admin/gaku' end end protected def authorize_admin begin record = model_class.new rescue record = Object.new end authorize! :admin, record authorize! params[:action].to_sym, record end end end end
Version data entries
16 entries across 16 versions & 2 rubygems