I have inputs which get loaded over ajax and get's inserted in a other form with javascript with this fields:
<input name="project[config][service][3][web][auth]" type="checkbox">
and two other inputs with:
<input type="text" name="project[config][service][3][web][user]">
<input type="text" name="project[config][service][3][web][pass]">
how can I permit this to the controller to accept the values?
I tried it with these:
params.require(:project).permit(
:title,
:description,
config: [
service: {
[] => [
:domains,
web: [
:auth,
:user,
:pass
]
]
}
],
documents: []
)
but it didn't worked.
In the console i have this as project_params[:config]
{"service"=><ActionController::Parameters {"3"=><ActionController::Parameters {} permitted: true>} permitted: true>}
the params[:project][:config] looks like this:
{
"service" => {
"3" => {
"web" => {
"auth"=>"on",
"user"=>"asdasdasdasda",
"pass"=>"asdasdasd"
}
}
}
}