Rails 4 form - no implicit conversion of Model into String

前端 未结 2 1535

After adding a helper method and edit my form, I\'m getting this error

TypeError in Posts#create

Showing /Users/jim/project/test/app/views/posts/_form.html.erb          


        
2条回答
  •  不思量自难忘°
    2021-01-22 00:43

    I have found the problem thanks to @sissy comment.

    I should pass @question = cookies[:question] instead of @question = Question.where(id: params[:post][:question_id]).first in my create action of my posts controller

    Thanks everyone for your help.

提交回复
热议问题