2013-12-20 65 views
2

复选框不显示,并且批量操作下拉列表对于我的所有ActiveAdmin页面都呈灰色显示。我admin/dashboard.rbActiveAdmin复选框和批处理操作不可用

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'

回答

12

您需要添加selectable_column所以有一种方法可以选择记录对应用批处理动作:

index do 
    selectable_column 
    # your columns here 
    actions 
end