I have a simple Rails 4 project with two scaffolded models: Practice and
Practitioner. I have set these both as habtm and am in the process of
adding checkboxes to the Practitioner form so that I can check off the
practices that this practitioner belongs to. In the
practitioners_controller, I added practice_ids to the
practitioner_params permit list, but I am still getting the error:
Started PATCH “/practitioners/1” for 127.0.0.1 at 2013-10-23 16:35:34
-0400
Processing by PractitionersController#update as HTML
Parameters: {“utf8”=>“✓”,
“authenticity_token”=>“u9XWBVshMKmLg+YhVFWu10PTQu+uvAbbvBck4QQG6wk=”,
“practitioner”=>{“first_name”=>“Christine”, “last_name”=>“Campbell”,
“degree”=>“CRNP”, “accepting_new_patients”=>“1”,
“specialty”=>“Obstetrics & Gynecology”, “secondary_specialty”=>"",
“c_v”=>“Undergraduate Education: 1988\r\nGraduate School Education:
1995\r\nAffiliations: Pottstown Memorial Hospital”,
“practice_ids”=>[nil, “1”]}, “commit”=>“Update Practitioner”, “id”=>“1”}
Practitioner Load (0.2ms) SELECT “practitioners”.* FROM
“practitioners” WHERE “practitioners”.“id” = ? ORDER BY
“practitioners”.last_name ASC, “practitioners”.first_name ASC LIMIT 1
[[“id”, “1”]]
Unpermitted parameters: practice_ids
when I try to update. If I comment out the practitioner_params method,
like this:
I haven’t delved into any of the updated texts for Rails 4 yet except
the Rails 4 In Action pre-publication version, and that still needs to
be updated for strong parameters. Soon, I hope.
I haven’t delved into any of the updated texts for Rails 4 yet except
the Rails 4 In Action pre-publication version, and that still needs to
be updated for strong parameters. Soon, I hope.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.