Module: C::ApplicationHelper

Includes:
FontAwesome::Rails::IconHelper
Defined in:
app/helpers/c/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#content_can_tag(tag, action, subject, content, opts = {}, &block) ⇒ Object



20
21
22
23
24
25
26
27
# File 'app/helpers/c/application_helper.rb', line 20

def content_can_tag(tag, action, subject, content, opts={}, &block)
  return unless can? action, subject
  if block
    opts = content || {}
    content = capture(&block)
  end
   tag, content, opts
end

#index_table(collection, index_data, opts = {}) ⇒ Object



29
30
31
32
33
# File 'app/helpers/c/application_helper.rb', line 29

def index_table(collection, index_data, opts={})
   :div, class: 'data_table' do
    render 'index_table', collection: collection, index_data: index_data, sortable: opts[:sortable], bulk_actions: opts[:bulk_actions]
  end
end

#path_exists?(path) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
17
18
# File 'app/helpers/c/application_helper.rb', line 11

def path_exists?(path)
  begin
    C::Engine.routes.recognize_path(path)
  rescue
    return false
  end
  true
end

#store_page_title(title) ⇒ Object



7
8
9
# File 'app/helpers/c/application_helper.rb', line 7

def store_page_title(title)
  title ? "#{title} | #{C.store_name}" : C.store_name
end

#tinymce_lightObject



43
44
45
46
47
48
# File 'app/helpers/c/application_helper.rb', line 43

def tinymce_light
  tinymce(height: 200,
          menubar: false,
          plugins: ['lists'],
          toolbar: 'undo redo | bold italic | bullist')
end

#tinymce_standardObject



35
36
37
38
39
40
41
# File 'app/helpers/c/application_helper.rb', line 35

def tinymce_standard
  tinymce(height: 200,
          menubar: false,
          plugins: ['autolink lists link image media charmap anchor',
                    'insertdatetime media table contextmenu paste code textcolor colorpicker'],
          toolbar: 'undo redo styleselect bold italic alignleft aligncenter alignright alignjustify bullist numlist link media uploadimage forecolor')
end