このエラーが発生します:
undefined method `has_many' for #<Formtastic::SemanticFormBuilder:0xb410d4c>
私がこのようにそれを使うとき、それは働きます:
ActiveAdmin.register Ressource do
form do |f|
f.inputs do
f.input :offer_id, :as => :hidden
f.input :name
f.input :category, :include_blank => false, :collection => Category.order('place ASC').all, :member_label => :to_label
f.input :description, :input_html => {:class => 'editor'}
f.input :price
end
f.has_many :roles do |app_f|
app_f.inputs do
if not app_f.object.id.nil?
app_f.input :_destroy, :as => :boolean, :label => "Supprimer l'utilisateur du lot"
end
app_f.input :user, :member_label => :to_label, :label => 'Assigné le lot'
app_f.input :name, :include_blank => false
end
end
f.buttons
end
end
しかし、それは部分的には機能しません、私は別の方法または何か他の方法でhas_manyメソッドを呼び出す必要がありますか?