I\'m new to Rails and built something based on this, but it needed small updates to make it compatible with Rails 4\'s strong parameters:
http://railscasts.com/episo
I found out the fix is that the whitelist needs to match the nesting of attributes. So to fix the above I changed this:
class SurveysController < ApplicationController
def survey_params
params.require(:survey).permit(:name, questions_attributes: [:id, :survey_id, :content])
end
to this:
class SurveysController < ApplicationController
def survey_params
params.require(:survey).permit(:name, questions_attributes: [:id, :survey_id, :content, answers_attributes: [:id, :question_id, :content]])
end
E.g. simply copy the whitelist of the answers_attributes and insert it inside before the closing "]" for the questions_attributes.
Hopefully this will help others with the same problem.