We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have in my partial:
json.key_format! camelize: :lower json.credit_balance @user.available_credits json.company_state @user.company_profile.state json.subscription do json.merge! @user.subscription.to_h end
But rendered json doesn't produced by following camelize: :lower rule.
camelize: :lower
{ "creditBalance": 28, "companyState": "NJ", "subscription": { "active": true, "current_period_end": "03/02/2020" } }
See current_period_end should be currentPeriodEnd.
current_period_end
currentPeriodEnd
I am using Rails 5.2.
The text was updated successfully, but these errors were encountered:
Fix for key_format! when using nested hashes
3c0c882
Converts the keys of all hashes within arrays and ones being merged in to follow the specified key format. Fixes rails#473
Fix for key_format! when using nested hashes (#486)
5c82764
Converts the keys of all hashes within arrays and ones being merged in to follow the specified key format. Fixes #473
I'm on gem version 2.11.2 and still experiencing this issue.
def as_json(options = nil) j = Jbuilder.new do |json| json.key_format! camelize: :lower json.merge! super.to_h end j.attributes! end
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
I have in my partial:
But rendered json doesn't produced by following
camelize: :lower
rule.See
current_period_end
should becurrentPeriodEnd
.I am using Rails 5.2.
The text was updated successfully, but these errors were encountered: