Skip to content
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

user params instead of query_parameters for nicer route paths #17

Closed
wants to merge 2 commits into from

Conversation

elfassy
Copy link
Contributor

@elfassy elfassy commented Oct 29, 2013

support for both (right now only the second is supported)

/api/v1/route
/api/route?api_version=1

Example routes file

namespace :api, defaults: {format: :json} do
      scope "(v:api_version)" do
          get 'route' ...
     end
end

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 81d1bfe on elfassy:master into 8ca3091 on bwillis:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 9c76f3c on elfassy:master into 8ca3091 on bwillis:master.

@bwillis
Copy link
Owner

bwillis commented Oct 29, 2013

Thanks for the pull request @elfassy. I remember using params originally and found that it was very overloaded. As I understand, params is the amalgamation of url params, query params as well as request params and Rails dictates what takes priority.

My intent was to allow the user, through configuration, to specify the priority, for example:

config.view_version_extraction_strategy = [:request_parameter, :query_parameter]

So, what you have found is that we are not addressing the url params. Can you see a way we can add the url params into this strategy and preserve priority?

@elfassy
Copy link
Contributor Author

elfassy commented Oct 30, 2013

Hi @bwillis. Thanks for this gem!
We can add a path_parameters strategy. I'll give it a shot, let me know what you think.

@bwillis
Copy link
Owner

bwillis commented Oct 30, 2013

That sounds like a great idea, looking forward to the update 👍

@elfassy
Copy link
Contributor Author

elfassy commented Oct 30, 2013

#18

@elfassy elfassy closed this Oct 30, 2013
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.

3 participants