I am trying to create a boolean toggle button to change a value in my model Question. I am just learning rails so bear with me.
In my view I created a button:
<%= link_to("Answered", question_path(question, :status => true), :method => :put) %>
when I look at the URL for the button it is :
hackerQ.com/questions/8?status=true
This is the Error I am given.
Rails ActionController::ParameterMissing in QuestionsController#update
# Never trust parameters from the scary internet, only allow the white list through.
def question_params
params.require(:question).permit(:topic, :question, :status, :user_id, :teacher_id)
end
end
My Question is should have have created a new action in my questions controller or added something to my params.require?