Sha256: 02078a152a6bac6e5b02fb2bb7dd43e4f07e007e931ccf67416f5d53f5058850

Contents?: true

Size: 651 Bytes

Versions: 16

Compression:

Stored size: 651 Bytes

Contents

module E9Crm::BaseHelper

  ##
  # Field maps
  #
  
  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

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
e9_crm-0.1.34 app/helpers/e9_crm/base_helper.rb
e9_crm-0.1.33 app/helpers/e9_crm/base_helper.rb
e9_crm-0.1.32 app/helpers/e9_crm/base_helper.rb
e9_crm-0.1.31 app/helpers/e9_crm/base_helper.rb
e9_crm-0.1.30 app/helpers/e9_crm/base_helper.rb
e9_crm-0.1.29 app/helpers/e9_crm/base_helper.rb
e9_crm-0.1.28 app/helpers/e9_crm/base_helper.rb
e9_crm-0.1.27 app/helpers/e9_crm/base_helper.rb
e9_crm-0.1.26 app/helpers/e9_crm/base_helper.rb
e9_crm-0.1.25 app/helpers/e9_crm/base_helper.rb
e9_crm-0.1.24 app/helpers/e9_crm/base_helper.rb
e9_crm-0.1.23 app/helpers/e9_crm/base_helper.rb
e9_crm-0.1.22 app/helpers/e9_crm/base_helper.rb
e9_crm-0.1.21 app/helpers/e9_crm/base_helper.rb
e9_crm-0.1.20 app/helpers/e9_crm/base_helper.rb
e9_crm-0.1.19 app/helpers/e9_crm/base_helper.rb