Sha256: 9c30ae670ecd4b3b64a7fadafe16ab7050b33af2dcd48cece6c77224494e8f96

Contents?: true

Size: 1.24 KB

Versions: 39

Compression:

Stored size: 1.24 KB

Contents

ActiveAdmin.register ProviderGroup do
  menu :parent => I18n.t('activerecord.models.provider.other'),
       :if     => proc { can? :index, ProviderGroup },
       :priority => 2

  #
  # INDEX
  #
  filter :id
  filter :title
  filter :provider_group, :input_html => { :class => 'chosen' }

  index do
    selectable_column
    column :id do |x|
      link_to x.id, [:admin, x]
    end
    column :icon do |x|
      image_tag(x.icon.url(:thumb)) unless x.icon.blank?
    end
    column :title
    column :provider_group
    column :created_at
    column :updated_at
    default_actions
  end

  #
  # SHOW
  #
  show do |provider_group|
    attributes_table do
      row :id
      row :title
      row :icon do
        image_tag(provider_group.icon) unless provider_group.icon.blank?
      end
      row :provider_group
      row :created_at
      row :updated_at
    end
  end

  #
  # FORM
  #
  form do |f|
    f.inputs do
      f.input :title
      f.input :provider_group, :input_html => { :class => 'chosen' },
        :collection => ProviderGroup.tree(f.object)
      f.input :icon, :hint => (
          unless provider_group.icon.blank?
            f.template.image_tag(provider_group.icon).html_safe
          end
        )
    end
    f.actions
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
smartkiosk-server-0.13.1 app/admin/provider_groups.rb
smartkiosk-server-0.13 app/admin/provider_groups.rb
smartkiosk-server-0.12.1 app/admin/provider_groups.rb
smartkiosk-server-0.12 app/admin/provider_groups.rb
smartkiosk-server-0.11.11 app/admin/provider_groups.rb
smartkiosk-server-0.11.10 app/admin/provider_groups.rb
smartkiosk-server-0.11.9 app/admin/provider_groups.rb
smartkiosk-server-0.11.8 app/admin/provider_groups.rb
smartkiosk-server-0.11.7 app/admin/provider_groups.rb
smartkiosk-server-0.11.6 app/admin/provider_groups.rb
smartkiosk-server-0.11.5 app/admin/provider_groups.rb
smartkiosk-server-0.11.4 app/admin/provider_groups.rb
smartkiosk-server-0.11.3 app/admin/provider_groups.rb
smartkiosk-server-0.11.2 app/admin/provider_groups.rb
smartkiosk-server-0.11.1 app/admin/provider_groups.rb
smartkiosk-server-0.11 app/admin/provider_groups.rb
smartkiosk-server-0.10.19 app/admin/provider_groups.rb
smartkiosk-server-0.10.18 app/admin/provider_groups.rb
smartkiosk-server-0.10.17 app/admin/provider_groups.rb
smartkiosk-server-0.10.16 app/admin/provider_groups.rb