Sha256: 4d982398506d890a1d1597ed3dae39e635db822737f3912b3dbd965e607a4932

Contents?: true

Size: 782 Bytes

Versions: 17

Compression:

Stored size: 782 Bytes

Contents

ActiveAdmin.register C80MapFloors::Setting, as: 'Setting' do

  menu :label => "Свойства", :parent => 'Карта', :if => proc { current_admin_user.email == 'tz007@mail.ru' }

  before_filter :skip_sidebar!, :only => :index

  permit_params :map_image

  config.sort_order = 'id_asc'

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

  index do
    column '' do |sp|
      "#{ link_to image_tag(sp.map_image.thumb.url), sp.map_image.url, :target => '_blank' }<br>
      ".html_safe
    end
    actions
  end

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

    f.inputs 'Свойства карты' do
      f.input :map_image, :hint => "#{image_tag(f.object.map_image.thumb.url)}".html_safe
    end

    f.actions
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
c80_map_floors-0.1.0.17 app/admin/c80_map_floors/settings.rb
c80_map_floors-0.1.0.16 app/admin/c80_map_floors/settings.rb
c80_map_floors-0.1.0.15 app/admin/c80_map_floors/settings.rb
c80_map_floors-0.1.0.14 app/admin/c80_map_floors/settings.rb
c80_map_floors-0.1.0.13 app/admin/c80_map_floors/settings.rb
c80_map_floors-0.1.0.12 app/admin/c80_map_floors/settings.rb
c80_map_floors-0.1.0.11 app/admin/c80_map_floors/settings.rb
c80_map_floors-0.1.0.10 app/admin/c80_map_floors/settings.rb
c80_map_floors-0.1.0.9 app/admin/c80_map_floors/settings.rb
c80_map_floors-0.1.0.8 app/admin/c80_map_floors/settings.rb
c80_map_floors-0.1.0.7 app/admin/c80_map_floors/settings.rb
c80_map_floors-0.1.0.6 app/admin/c80_map_floors/settings.rb
c80_map_floors-0.1.0.5 app/admin/c80_map_floors/settings.rb
c80_map_floors-0.1.0.4 app/admin/c80_map_floors/settings.rb
c80_map_floors-0.1.0.3 app/admin/c80_map_floors/settings.rb
c80_map_floors-0.1.0.2 app/admin/c80_map_floors/settings.rb
c80_map_floors-0.1.0.1 app/admin/c80_map_floors/settings.rb