活动管理员中的best_in_place内联错误

时间:2015-09-07 13:05:50

标签: ruby-on-rails ruby ruby-on-rails-4 gem activeadmin

我需要直接从索引内联更改布尔字段,而不必从编辑页面传递。

当我将gem best_in_place放入index:

时,我在activeadmin中收到此错误

未定义的方法`事件'对于#

这是我的代码:

column :active do |billboard|
      best_in_place billboard,
                :active,
                as: :checkbox,
                path: [:admin, billboard.event, billboard],
                collection: %w[HIDE SHOW]

这里是我的整个代码:

  index do
    column :name
    column :description
    column :active
    column :attempts_number
    column :finished
    column :created_at
    # gem best_in_place
    column :active do |billboard|
      best_in_place billboard,
                :active,
                as: :checkbox,
                path: [:admin, billboard.event, billboard],
                collection: %w[HIDE SHOW]
    end
    actions
  end

1 个答案:

答案 0 :(得分:0)

确保您的代码在

[0.999, 0.998, 0.997, 0.996, 0.995, 0.994, 0.993, 0.992, 0.991]

然后您将在索引页面中获得预期结果