ActiveAdmin复选框和批处理操作不可用

时间:2013-12-20 23:00:47

标签: ruby-on-rails activeadmin

复选框无法显示,并且所有ActiveAdmin页面的批处理操作下拉列表都显示为灰色。我的admin/dashboard.rb

ActiveAdmin.register_page "Dashboard" do

  menu :priority => 1, :label => proc{ I18n.t("active_admin.dashboard") }

  content :title => proc{ I18n.t("active_admin.dashboard") } do
    div :class => "blank_slate_container", :id => "dashboard_default_message" do
      span :class => "blank_slate" do
        span I18n.t("active_admin.dashboard_welcome.welcome")
        small I18n.t("active_admin.dashboard_welcome.call_to_action")
      end
    end

  end # content
end

示例Admin.registerVotes

ActiveAdmin.register Vote do
  permit_params :ip_address, :weight, :response_id

  index do
    column :response
    column :weight
    column :ip_address
  end

  form do |f|
    f.inputs do
      f.input :response
      f.input :ip_address, :as => :string
      f.input :weight
    end
    f.actions
  end
end

Gemfile条目:gem 'activeadmin', github: 'gregbell/active_admin'

1 个答案:

答案 0 :(得分:12)

您需要添加selectable_column,以便选择要应用批处理操作的记录:

index do
  selectable_column
  # your columns here
  actions
end