To prevent double wrapping of JSON, requiring things such as entry.entry.title use:

config/initializers/wrap_parameters.rb
1
2
3
4
5
6
7
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActionController::Base.wrap_parameters format: [:json]

# Disable root element in JSON by default.
if defined?(ActiveRecord)
  ActiveRecord::Base.include_root_in_json = false
end

Comments