Module: E9Crm::BaseHelper

Defined in:
app/helpers/e9_crm/base_helper.rb

Instance Method Summary collapse

Instance Method Details

#records_table_field_map(options = {}) ⇒ Object

Field maps



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/helpers/e9_crm/base_helper.rb', line 7

def records_table_field_map(options = {})
  options.symbolize_keys!
  options.reverse_merge!(:class_name => resource_class.name.underscore)

  base_map = {
    :fields => { :id => nil },
    :links => lambda {|r| [link_to_edit_resource(r), link_to_destroy_resource(r)] }
  }

  method_name = "records_table_field_map_for_#{options[:class_name]}"

  if respond_to?(method_name)
    base_map.merge! send(method_name)
  end

  base_map
end

#sortable_controller?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'app/helpers/e9_crm/base_helper.rb', line 25

def sortable_controller?
  @_sortable_controller ||= controller.class.ancestors.member?(E9Rails::Controllers::Sortable)
end