Rails has quite a few security related configurations. One of which relates to enforcing mass assignment protection.
config.active_record.whitelist_attributes=false
This configuration forces an application developer to whitelist attributes that can be modified with mass-assignment. When this configuration is set to false any attribute can be mass-assigned.
config.active_record.whitelist_attributes=trueOnce this configuration is updated to true and the application is restarted, any attributes to be mass-assigned will have to be defined as attr_accessible.
When the following setting is set to false, HTML entities in JSON response will not be encoded.
ActiveSupport::escape_html_entities_in_json = false
Edit the html_entities file at config/initializers/html_entities.rb and set the following to true.
ActiveSupport::escape_html_entities_in_json = true
Once the initializer is edited and the application is restarted, any HTML entities in JSON responses will be encoded.