Sha256: 54bcc9fa8a49c25692073ad34d95536fb11e13e6d8345b07097aab14a495707e

Contents?: true

Size: 902 Bytes

Versions: 3

Compression:

Stored size: 902 Bytes

Contents

ActiveAdmin.register C80Catoffers::Price, as: 'Price' do

  menu :label => 'Прайсы', # TODO_MY:: название пункта меню перенесести в параметры в базу
       priority: 3,
       parent: 'Услуги' # TODO_MY:: название пункта меню перенесести в параметры в базу

  permit_params :title,
                :file

  batch_action :destroy, false

  before_filter :skip_sidebar!, :only => :index

  index do
    column :title
    column :file do |price|
      link_to price.file, price.file.url, { :target => '_blank' }
    end
    actions
  end

  form(:html => {:multipart => true}) do |f|
    f.inputs 'Свойства' do

      f.input :title
      f.input :file,
              :as => :file,
              :hint => f.object.file.url #f.template.asset_url(f.object.file.url)

    end
    f.actions
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
c80_catoffers-0.1.0.8 app/admin/c80_catoffers/prices.rb
c80_catoffers-0.1.0.7 app/admin/c80_catoffers/prices.rb
c80_catoffers-0.1.0.6 app/admin/c80_catoffers/prices.rb