I have a user which has a has_one to profile like this:
class User < ActiveRecord::Base has_one :profile ... class Profile < ActiveRecord::Base belongs_to :user
I would think I'd be able to
build a profile but I get the following error:
@user37=User.find(37)  pry(main)> @user37.profile.build Profile Load (0.3ms) SELECT `profiles`.* FROM `profiles` WHERE `profiles`.`user_id` = 37 LIMIT 1 NoMethodError: undefined method `build' for nil:NilClass from (pry):9:in `__pry__'  pry(main)>
How woudl I build this relationship via rails cli?