If you're using accepts_nested_attributes_for
, the idea is that you'd submit the attributes for the Description
model as part of the form for your User
model. That doesn't appears to be what you're doing here.
If you don't want to do that, you should remove that line and in your controller do
current_user.build_description(description_params)
(or you can use #create_description
if you want to initialize/save all at once).
For example
def create
@description = current_user.create_description(description_params)
redirect_to student_path
end
See the Active Record Associations guide for documentation for these has_one
methods.