Вопрос по ruby-on-rails-3 – Rails wrap_parameters против include_root_in_json, в чем разница?

25

Error: User Rate Limit Exceeded

ActiveSupport.on_load(:action_controller) do
  wrap_parameters format: [:json]
end

# Disable root element in JSON by default.
ActiveSupport.on_load(:active_record) do
  self.include_root_in_json = false
end

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Ваш Ответ

1   ответ
66

include_root_in_jsonError: User Rate Limit Exceeded

wrap_parametersError: User Rate Limit Exceeded

Error: User Rate Limit Exceededwrap_parametersError: User Rate Limit Exceeded

{name: 'John Smith'}

Error: User Rate Limit ExceededreceivedError: User Rate Limit Exceeded

{"person": {name: 'John Smith'}}

include_root_in_jsonError: User Rate Limit ExceededgeneratesError: User Rate Limit Exceededto_jsonError: User Rate Limit Exceeded


Error: User Rate Limit ExceededPerson.to_jsonError: User Rate Limit Exceededinclude_root_in_jsonError: User Rate Limit Exceeded

{"person": {name: 'James Brown'}}

Error: User Rate Limit Exceeded

{name: 'John Smith'}

Error: User Rate Limit Exceededrails new my-app --api

Похожие вопросы