Sha256: 5c47f48d5484b3e62a0f48bafbfc91555c793acc97c3650fa3cbf8ac9e218476

Contents?: true

Size: 715 Bytes

Versions: 6

Compression:

Stored size: 715 Bytes

Contents

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

  menu :label => "Свойства", :parent => 'Карта'

  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

6 entries across 6 versions & 1 rubygems

Version Path
c80_map-0.1.0.12 app/admin/c80_map/settings.rb
c80_map-0.1.0.11 app/admin/c80_map/settings.rb
c80_map-0.1.0.10 app/admin/c80_map/settings.rb
c80_map-0.1.0.2 app/admin/c80_map/settings.rb
c80_map-0.1.0.1 app/admin/c80_map/settings.rb
c80_map-0.1.0 app/admin/c80_map/settings.rb