Sha256: 41b1669cdbcfff2282226f97fe768765bdff37072de810a181d40ecb5226e3c6

Contents?: true

Size: 825 Bytes

Versions: 10

Compression:

Stored size: 825 Bytes

Contents

module Comfy
  module Admin
    module CmsHelper

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

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

      # Injects some content somewhere inside cms admin area
      def cms_hook(name, options = {})
        ComfortableMexicanSofa::ViewHooks.render(name, self, options)
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-2.0.9 app/helpers/comfy/admin/cms_helper.rb
comfortable_mexican_sofa-2.0.8 app/helpers/comfy/admin/cms_helper.rb
comfortable_mexican_sofa-2.0.7 app/helpers/comfy/admin/cms_helper.rb
comfortable_mexican_sofa-2.0.6 app/helpers/comfy/admin/cms_helper.rb
comfortable_mexican_sofa-2.0.5 app/helpers/comfy/admin/cms_helper.rb
comfortable_mexican_sofa-2.0.4 app/helpers/comfy/admin/cms_helper.rb
comfortable_mexican_sofa-2.0.3 app/helpers/comfy/admin/cms_helper.rb
comfortable_mexican_sofa-2.0.2 app/helpers/comfy/admin/cms_helper.rb
comfortable_mexican_sofa-2.0.1 app/helpers/comfy/admin/cms_helper.rb
comfortable_mexican_sofa-2.0.0 app/helpers/comfy/admin/cms_helper.rb