Sha256: e37df6b4954cca8ea9eaf7e7b236526f9cd6aee7a90f2d0c669ba755bec2292a

Contents?: true

Size: 1.06 KB

Versions: 8

Compression:

Stored size: 1.06 KB

Contents

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

  config.per_page = 100

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

  permit_params :positions_count,
                :offer_ids => []

  batch_action :destroy, false

  config.sort_order = 'id_asc'

  before_filter :skip_sidebar!, :only => :index

  index do
    # selectable_column
    column 'Список который выводится в виджете' do |prop|
      res = ''
      prop.offers.map do |offer|
        res += "<li>#{offer.title}</li>"
      end
      "<ul>#{res}</ul>".html_safe
    end
    column :positions_count
    actions
  end

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

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

      f.input :offers,
              :as => :check_boxes
      f.input :positions_count

    end

    f.actions
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
c80_catoffers-0.1.0.8 app/admin/c80_catoffers/props.rb
c80_catoffers-0.1.0.7 app/admin/c80_catoffers/props.rb
c80_catoffers-0.1.0.6 app/admin/c80_catoffers/props.rb
c80_catoffers-0.1.0.5 app/admin/c80_catoffers/props.rb
c80_catoffers-0.1.0.4 app/admin/c80_catoffers/props.rb
c80_catoffers-0.1.0.3 app/admin/c80_catoffers/props.rb
c80_catoffers-0.1.0.2 app/admin/c80_catoffers/props.rb
c80_catoffers-0.1.0.1 app/admin/c80_catoffers/props.rb