Running into problems where `user_id=' for nil:NilClass
I am trying to make a forum and i keep running into this problem. apparently the forum threads has an id but the forum msgs always returns a nil value.
I have this in my controller:
@forum_thread = current_user.forum_threads.new(forum_thread_params)
@forum_thread.forum_msgs.first.user_id = current_user.id
render action: :new
Posted about 3 years ago by