Sha256: 042a9813a4652e35c728a377f77667259c5a1793359121844c8167d64f84b629

Contents?: true

Size: 667 Bytes

Versions: 6

Compression:

Stored size: 667 Bytes

Contents

module IndexListPatch

  protected

  def build_index_list(index_class)
    aa_data[:index_list] ||= []
    url = url_for(as: index_class.index_name.to_sym)
    name = index_class.index_name
    i18n_name = I18n.t("active_admin.index_list.#{name}", default: name.to_s.titleize)

    li class: classes_for_index(index_class) do
      a href: url, class: "table_tools_button" do
        i18n_name
      end
    end

    aa_data[:index_list] << {
      name: name,
      i18n_name: i18n_name,
      url: url,
      current: current_index?(index_class)
    }
  end

end

module ActiveAdmin
  module Views
    class IndexList
      prepend IndexListPatch
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
activeadmin_custom_layout-0.1.9 lib/activeadmin_custom_layout/layout/components/index_list.rb
activeadmin_custom_layout-0.1.8 lib/activeadmin_custom_layout/layout/components/index_list.rb
activeadmin_custom_layout-0.1.7 lib/activeadmin_custom_layout/layout/components/index_list.rb
activeadmin_custom_layout-0.1.6 lib/activeadmin_custom_layout/layout/components/index_list.rb
activeadmin_custom_layout-0.1.5 lib/activeadmin_custom_layout/layout/components/index_list.rb
activeadmin_custom_layout-0.1.4 lib/activeadmin_custom_layout/layout/components/index_list.rb