Module: Comfy::Admin::CmsHelper

Defined in:
app/helpers/comfy/admin/cms_helper.rb

Instance Method Summary collapse

Instance Method Details

#cms_hook(name, options = {}) ⇒ Object

Injects some content somewhere inside cms admin area



23
24
25
# File 'app/helpers/comfy/admin/cms_helper.rb', line 23

def cms_hook(name, options = {})
  ComfortableMexicanSofa::ViewHooks.render(name, self, options)
end

#comfy_admin_partial(path, params = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'app/helpers/comfy/admin/cms_helper.rb', line 12

def comfy_admin_partial(path, params = {})
  render path, params
rescue ActionView::MissingTemplate
  if ComfortableMexicanSofa.config.reveal_cms_partials
    (:div, class: "comfy-admin-partial") do
      path
    end
  end
end

#comfy_form_for(record, options = {}, &block) ⇒ Object

Wrapper around ComfortableMexicanSofa::FormBuilder



6
7
8
9
10
# File 'app/helpers/comfy/admin/cms_helper.rb', line 6

def comfy_form_for(record, options = {}, &block)
  options[:builder] = ComfortableMexicanSofa::FormBuilder
  options[:layout] ||= :horizontal
  bootstrap_form_for(record, options, &block)
end