0

I have a survey with many answers that I'm trying to pass through Strong Params. The problem is that surveys all have a different amount of answers (from 1..200).

Each answer is being passed to params like "answers" => {1: "Answer", 2: "Answer2", 4: "Answer4"}

How do I define this in strong params when I'm not sure how many, or which keys there will be?

Jackson Cunningham
  • 4,973
  • 3
  • 30
  • 80

1 Answers1

0

Found the answer:

Rails hashes with unknown keys and strong parameters

Basically don't use strong params unless you know which keys to expect

Community
  • 1
  • 1
Jackson Cunningham
  • 4,973
  • 3
  • 30
  • 80