Skip to content

Add a magic line to rails example to make the api json Mime::Type work #98

New issue

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

Merged
merged 1 commit into from
Feb 10, 2017

Conversation

yonga9121
Copy link
Contributor

No description provided.

@fotinakis
Copy link
Owner

Hey @yonga9121, this looks fine to me and it's just the example. I can't seem to find docs that validate this is correct, could you point me at something?

@yonga9121
Copy link
Contributor Author

Hey @fotinakis !! thank you for your reply. You can check this:

             def self.new(app, parsers = {})
               ActiveSupport::Deprecation.warn('ActionDispatch::ParamsParser is deprecated and will be removed in Rails 5.1. Configure the parameter parsing in ActionDispatch::Request.parameter_parsers.')
               parsers = parsers.transform_keys { |key| key.respond_to?(:symbol) ? key.symbol : key }
               ActionDispatch::Request.parameter_parsers =  ActionDispatch::Request::DEFAULT_PARSERS.merge(parsers)
               app
             end

This is the deprecated method, you can find it in the rails docs: http://api.rubyonrails.org/classes/ActionDispatch/ParamsParser.html.

We're working on a rails 5 project and we noticed that the method used in your documentation is not complete, the DEFAULT_PARSER hash was not reflecting the changes in ActionDispatch::Request.parameter_parsers, so we did some research and we found that the ActionDispatch::Request.parameter_parsers = ActionDispatch::Request::DEFAULT_PARSERS resolves the issue, we know that is just an example, however, we believe that it may help you to troubleshoot other Git issue you have in your issue list.

@fotinakis
Copy link
Owner

LGTM thanks! 🍰 👍

@fotinakis fotinakis merged commit 9854e96 into fotinakis:master Feb 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants