【问题标题】:Form Helper not found when using select_recurring for Ice_Cube with Formtastic and ActiveAdmin.使用带有 Formtastic 和 ActiveAdmin 的 Ice_Cube 的 select_recurring 时找不到表单助手。
【发布时间】:2014-05-29 13:23:41
【问题描述】:

当在带有 ActiveAdmin 的 Formtastic 中为 Ice_Cube gem 使用 select_recurring 表单助手时,我收到 unable to find input class for select_recurring 错误。

  form do |f|
    #Debugging
    f.semantic_errors *f.object.errors.keys

    f.inputs do
      f.input :title
      f.input :description,  :hint => "Full description for the event"
      f.input :short_description, :hint => "Shot description for the event that will be displayed as a thumbnail"
      f.input :published
      f.input :event_date
      f.input :recurring_rule, :as => :select_recurring
    end

    f.actions
  end

直接访问它(如下)适用于重复计划元素,但会破坏所有其余的 formtastic f.input 元素。

f.select_recurring :recurring_schedule

如何将select_recurring 合并到 ActiveAdmin 中?

【问题讨论】:

标签: ruby-on-rails-4 activeadmin formtastic ice-cube


【解决方案1】:

为我工作 (AA 1.0.0.pre1)

form do |f|
  f.inputs do
  #...
    li do
      f.label :recurring_rule_column
      f.select_recurring :recurring_rule_column, nil, :allow_blank => true
    end
  #...
  end
  f.submit
end

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-23
    相关资源
    最近更新 更多