-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Closed
Description
I have two models that has a has_one and belongs_to association with one another i.e
class User < ActiveRecord::Base
has_one :hammer, dependent: :destroy
accepts_nested_attributes_for :hammer, allow_destroy: true
end
class Hammer < ActiveRecord::Base
belongs_to :user
endAfter creating said models, I went on to make a form with these nested models following the documentation for it. However, I couldn't do so because I keep having this undefined method '<<' for nil:NilClass error that points to this particular code on the stacktrace
Snippet of the code I'm using that makes this happen:
form do |f|
f.inputs 'User Information' do
# user information inputs
end
f.inputs 'Hammer Information' do
# below is where the error happens
f.has_many :hammer do |h|
end
end
endIs there anyway I can fix this?
Version of ActiveAdmin and Rails I'm currently using if it's needed:
- activeadmin (1.0.0pre1)
- activeadmin_addons (1.2.0)
- Rails 4.2.6
Thanks in advance!
pragun16
Metadata
Metadata
Assignees
Labels
No labels
