Sha256: ea547e0782f8eafc61a5a05221a40404e8f3b0863f522262aab7ca812c8dd8c6
Contents?: true
Size: 1.12 KB
Versions: 20
Compression:
Stored size: 1.12 KB
Contents
# ПОДкатегории строительных материалов ActiveAdmin.register C80Yax::Cat, as: 'Cat' do menu :label => proc{ I18n.t('c80_yax.active_admin.menu.cat')}, :parent => 'x_c80_yax', :priority => 1 permit_params :title, :slug, :ord, :image, :strsubcat_ids => [] config.batch_actions = false config.sort_order = 'id_asc' before_filter :skip_sidebar!, :only => :index index do id_column column :ord column :title column :image do |cat| cat_image_tag(cat) end column :strsubcats do |cat| res = '-' if cat.strsubcats.count > 0 res = '' cat.strsubcats.map do |strsubcat| res += "• #{strsubcat.title}<br>" end end res.html_safe end actions end form(:html => {:multipart => true}) do |f| f.inputs 'Свойства категории' do f.input :title f.input :ord f.input :image, :as => :file, :hint => cat_image_tag(f.object) f.input :strsubcats, :as => :check_boxes end f.actions end end
Version data entries
20 entries across 20 versions & 1 rubygems