On Monday, April 21, 2014 10:25:01 AM UTC-4, Joy G. wrote:
Thanks to all in advance.
I’m pretty sure the error is in the register_params of the organiser
controller, but I don’t know why it’s happening. it looks like you have
the correct formats. When you have “f.fields_for :user” it will pass
parameters as [user][email], [user][first_name], etc. It looks to me
it’s seeing a parameter [user], it isn’t permitted in the strong
parameters, and it’s throwing an error. However, you have
accepts_nested_attributes_for defined and usually when you use the hash
user_attributes in strong parameters, rails takes care of that. You
try the following:
params.require(:organiser).permit(:city, :mobile, user: [:first_name,
:last_name, … , :authenticable_type])
if that works, I’m not sure why it’s necessary. When I have time, I’ll
to play with this. The only difference between this and other instances
I’ve seen of this type of structure is that in this case, both the
and the associated child record are new vs other situations where the
parent is already established and you’re adding a new child record.
I haven’t really given you a definitive answer here but hopefully it
give you some ideas on where to focus your efforts.