I have these relationships:
class Applicant < ActiveRecord::Base
has_many :answers
accepts_nested_attributes_for :answers
end
class Answer < ActiveRecord::Base
belongs_to :applicant
end
The answer model has an hstore attribute called properties. The properties hash will have dynamic keys as they are created in the app by the user.
I can't seem to successfully whitelist these dynamic keys within the applicants controller.
This is my current (unsuccessful) attempt.
def applicant_params
params.require(:applicant).permit(:answers_attributes: [:question_id, :id]).tap do |whitelisted|
whitelisted[:answers_attributes][:properties] = params[:applicant][:answers_attributes][:properties]
end
end
Thanks for any help.