Skip to main content

Survey - adding options though nested models

General • Asked by Chris Ma

Hey guys, a while ago, I tried to follow a railscast tutorial(notably http://railscasts.com/episodes/197-nested-model-form-part-2?view=asciicast) on nested models where i was trying to build a survey platform where admins could log in an build survey in a very Survey Monkey manner. I'm a bit lost at how this adds questions and gets saved(I dont get how whenever I add questions, it knows where to save the data), could someone explain what actually happens? Also is there a better way to address the same issue now?
Cheers,
Chris


There's an updated version of that screencast here: http://railscasts.com/episodes/196-nested-model-form-revised

That is also outdated, but it's all still useful. Instead of using attr_accessible, you'll have to use strong parameters in your controller. Remember to add question_ids: [].


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.