Sha256: dd6f8ebf141ead0cbf2a949df70b97dfb811575298096f24ed81126d23151793

Contents?: true

Size: 1001 Bytes

Versions: 6

Compression:

Stored size: 1001 Bytes

Contents

ActiveAdmin.register C80NewsTz::Banner02, :as => 'Banner02' do

  menu :label => "Рекламный блок №2", :parent => 'Баннеры'

  permit_params :title,
                :image,
                :href,
                :is_active

  config.sort_order = 'title_asc'

  filter :title
  filter :href
  filter :is_active

  # controller do
  #   cache_sweeper :suit_sweeper, :only => [:update,:create,:destroy]
  # end

  index do
    selectable_column
    id_column
    column :title
    column :image do |a|
      if a.image.present?
        "#{image_tag("#{a.image.thumb_preview.url}")}".html_safe
      end
    end
    column :href
    column :is_active
    column :shown
    column :clicks

    actions
  end

  form(:html => {:multipart => true}) do |f|

    f.inputs "Свойства" do

      f.input :title
      f.input :href
      f.input :image, :hint => "#{image_tag("#{f.object.image.thumb_preview.url}")}".html_safe
      f.input :is_active
    end

    f.actions
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
c80_news_tz-0.1.1.26 app/admin/c80_news_tz/banners02.rb
c80_news_tz-0.1.1.25 app/admin/c80_news_tz/banners02.rb
c80_news_tz-0.1.1.24 app/admin/c80_news_tz/banners02.rb
c80_news_tz-0.1.1.23 app/admin/c80_news_tz/banners02.rb
c80_news_tz-0.1.1.22 app/admin/c80_news_tz/banners02.rb
c80_news_tz-0.1.1.21 app/admin/c80_news_tz/banners02.rb