Module: SigbitAdminRails::PageHeaderHelper

Defined in:
lib/sigbit_admin_rails/helpers/page_header_helper.rb

Instance Method Summary collapse

Instance Method Details

#page_header(title, *args, &block) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/sigbit_admin_rails/helpers/page_header_helper.rb', line 3

def page_header(title, *args, &block)
  options = {breadcrumbs_position: 'top'}
  options.merge!(args.extract_options!)
   :div, class: 'row page-header' do
    html = (:div, class: "#{options[:class] ||= 'col-xs-12'}") do
      inner = ''
      inner << breadcrumbs(options[:breadcrumbs]) if options[:breadcrumbs].present? && options[:breadcrumbs_position] == 'top'
      inner << (:h1, title)
      inner << breadcrumbs(options[:breadcrumbs]) if options[:breadcrumbs].present? && options[:breadcrumbs_position] == 'bottom'
      inner.html_safe
    end
    html << capture(&block) if block_given?
    html.html_safe
  end
end