I'm having an issue of the answers not saving. They params seem to pass: "questions_attributes"=>{"0"=>{"required"=>"0"
"kind"=>"option_select"
"answers_attributes"=>{"1315562216665"=>{"text"=>"asdf"
"_destroy"=>"false"}
"1315562221010"=>{"text"=>"asdfasdfasdf"
"_destroy"=>"false"}
"1315562222968"=>{"text"=>"asdfff"
"_destroy"=>"false"}
"1315562215593"=>{"text"=>"asdf"
"_destroy"=>"false"}
"1315562219528"=>{"text"=>"asdfasdf"
"_destroy"=>"false"}
"1315562218369"=>{"text"=>"asdf"
"_destroy"=>"false"}}
"id"=>"8"
"_destroy"=>"false"
"content"=>"How long have you been a Christian?"}
How expensive would this solution be if you have 100,000+ interactions a day on your site? Does this scale well?
You could just:
request.user_agent =~ /android|blackberry|iphone|ipad|ipod|iemobile|mobile|webos/i
Rather than going through each individually and you can ignore case.
Under the validate_card method you'll have to change:
to
errors.add :base, message
Can you post the full code for everything? I'm also wanting to save the step to the db. Thanks!
Disregard this... the
reject_if
was set to reject if the attribute:content
was empty but my attribute was called:text
. Fixed it!I'm having an issue of the answers not saving. They params seem to pass:
"questions_attributes"=>{"0"=>{"required"=>"0"
"kind"=>"option_select"
"answers_attributes"=>{"1315562216665"=>{"text"=>"asdf"
"_destroy"=>"false"}
"1315562221010"=>{"text"=>"asdfasdfasdf"
"_destroy"=>"false"}
"1315562222968"=>{"text"=>"asdfff"
"_destroy"=>"false"}
"1315562215593"=>{"text"=>"asdf"
"_destroy"=>"false"}
"1315562219528"=>{"text"=>"asdfasdf"
"_destroy"=>"false"}
"1315562218369"=>{"text"=>"asdf"
"_destroy"=>"false"}}
"id"=>"8"
"_destroy"=>"false"
"content"=>"How long have you been a Christian?"}
But it doesn't end up saving.
Models (answer.rb, question.rb, and trip.rb (in place of survey.rb)) are identical to the show notes.
Any ideas on what I'm missing? Thanks!