Sha256: d3a6fd61c80cf4b0a95536a68b98a8753a9b1ae97f9256b80149954e5f82da63

Contents?: true

Size: 1.02 KB

Versions: 7

Compression:

Stored size: 1.02 KB

Contents

ActiveAdmin.register C80Wslider2::Frame, as: 'Frame' do

  menu :label => 'Фреймы', # TODO_MY:: название пункта меню перенесести в параметры в базу
       priority: 2,
       parent: 'Слайдер'# TODO_MY:: название пункта меню перенесести в параметры в базу

  permit_params :title,
                :image

  # batch_action :destroy, false
  config.per_page = 100
  config.sort_order = 'id_asc'
  before_filter :skip_sidebar!, :only => :index

  index do
    selectable_column
    column :title
    column :image do |frame|
      if frame.image.present?
        link_to image_tag(frame.image.thumb_preview), image_path(frame.image.thumb_big), target: '_blank'
      end
    end
    actions
  end

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

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

      f.input :title
      f.input :image,
               :as => :file,
               :hint => image_tag(f.object.image.thumb_preview)

    end

    f.actions
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
c80_wslider2-0.1.0.7 app/admin/c80_wslider2/frames.rb
c80_wslider2-0.1.0.6 app/admin/c80_wslider2/frames.rb
c80_wslider2-0.1.0.5 app/admin/c80_wslider2/frames.rb
c80_wslider2-0.1.0.4 app/admin/c80_wslider2/frames.rb
c80_wslider2-0.1.0.3 app/admin/c80_wslider2/frames.rb
c80_wslider2-0.1.0.2 app/admin/c80_wslider2/frames.rb
c80_wslider2-0.1.0.1 app/admin/c80_wslider2/frames.rb