You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using gon with Jbuilder and the key_format! :camelize :lower option, array database attributes are incorrectly parsed to json. Visiting the .json route displays the correctly parsed JSON from Jbuilder, but the JSON from Gon inside the <head> tag on the page is incorrect.
Example:
Attribute is stored in a database array attribute:
Jbuilder template uses the key_format! option to convert snake_case to camelCase:
_form.json.jbuilder
json.key_format! camelize: :lower
json.rules @rules do |rule|
json.(rule, :id)
json.conditionsAttributes rule.conditions do |condition|
json.(condition, :determinant_name, :condition_value, :operator)
end
end
When using gon with Jbuilder and the
key_format! :camelize :lower
option, array database attributes are incorrectly parsed to json. Visiting the .json route displays the correctly parsed JSON from Jbuilder, but the JSON from Gon inside the<head>
tag on the page is incorrect.Example:
Attribute is stored in a database array attribute:
schema.rb
Jbuilder template uses the
key_format!
option to convert snake_case to camelCase:_form.json.jbuilder
Expected result:
Actual result:
The text was updated successfully, but these errors were encountered: