Module: BHM::Admin

Defined in:
lib/bhm/admin.rb,
lib/bhm/admin/engine.rb,
lib/bhm/admin/sidebar_helper.rb,
lib/bhm/admin/compass_framework.rb,
lib/bhm/admin/nested_form_helper.rb,
lib/bhm/admin/presentation_helper.rb,
lib/bhm/admin/attr_accessible_scoping.rb

Defined Under Namespace

Modules: AttrAccessibleScoping, NestedFormHelper, PresentationHelper, SidebarHelper Classes: Engine

Constant Summary collapse

VERSION =
"0.3.6".freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.site_nameObject

Returns the value of attribute site_name.



14
15
16
# File 'lib/bhm/admin.rb', line 14

def site_name
  @site_name
end

Class Method Details

.disable_attr_accessible(&blk) ⇒ Object



33
34
35
# File 'lib/bhm/admin.rb', line 33

def self.disable_attr_accessible(&blk)
  AttrAccessibleScoping.disable(&blk)
end

.disable_attr_accessible!Object



41
42
43
# File 'lib/bhm/admin.rb', line 41

def self.disable_attr_accessible!
  AttrAccessibleScoping.disable!
end

.enable_attr_accessible!Object



45
46
47
# File 'lib/bhm/admin.rb', line 45

def self.enable_attr_accessible!
  AttrAccessibleScoping.enable!
end

.helper_classesObject



29
30
31
# File 'lib/bhm/admin.rb', line 29

def self.helper_classes
  [SidebarHelper, PresentationHelper, NestedFormHelper]
end

.register_compass_framework!Object



4
5
6
7
8
9
# File 'lib/bhm/admin/compass_framework.rb', line 4

def self.register_compass_framework!
  root_path = File.expand_path('../../../compass', File.dirname(__FILE__))
  Compass::Frameworks.register 'bhm-admin',
    :stylesheets_directory => File.join(root_path, 'stylesheets'),
    :templates_directory   => File.join(root_path, 'templates')
end

.rootObject



25
26
27
# File 'lib/bhm/admin.rb', line 25

def self.root
  @_bhm_admin_root ||= Pathname(__FILE__).dirname.dirname.dirname
end

.silence_attr_accessible(&blk) ⇒ Object



37
38
39
# File 'lib/bhm/admin.rb', line 37

def self.silence_attr_accessible(&blk)
  AttrAccessibleScoping.silence(&blk)
end

.t(*args) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/bhm/admin.rb', line 17

def self.t(*args)
  options = args.extract_options!
  options[:scope] = ["bhm.admin", options.delete(:scope)].flatten.compact.join(".")
  args.unshift args.shift.to_sym
  args << options
  ::I18n.t(*args)
end