If an error in a CbrainTask's params is recorded, where the param is deep inside the hash, as in the paramspathmyhash[mykey] or deeper:
task.params_errors["myhash[mykey]"] = "is bad"
then in the task's param's page the field will not by highlighted in red. The reason is that the ID of the input field will be provided by the .to_la_id() method and will be shown as
<input id="cbrain_task_params_myhash_mykey">
whereas in the params_errors object they key is stored as the symbol :"cbrain_task_params_myhash[mykey]" (yes a symbol with brackets in its name).
This was convenient because it allowed the entire API of ParamsErrors to always provide the developer a consistent interface using paramspaths; however now Rails fail to match the ID and the fact that an error was recorded.
Not sure how to solve that yet; maybe stuff the errors object with a duplicate key :cbrain_task_params_myhash_mykey key ?
If an error in a CbrainTask's params is recorded, where the param is deep inside the hash, as in the paramspath
myhash[mykey]
or deeper:then in the task's param's page the field will not by highlighted in red. The reason is that the ID of the input field will be provided by the
.to_la_id()
method and will be shown aswhereas in the params_errors object they key is stored as the symbol
:"cbrain_task_params_myhash[mykey]"
(yes a symbol with brackets in its name).This was convenient because it allowed the entire API of ParamsErrors to always provide the developer a consistent interface using paramspaths; however now Rails fail to match the ID and the fact that an error was recorded.
Not sure how to solve that yet; maybe stuff the errors object with a duplicate key
:cbrain_task_params_myhash_mykey
key ?