path option is now used when generating url paths#959
Open
beniutek wants to merge 1 commit intoJSONAPI-Resources:masterfrom
Open
path option is now used when generating url paths#959beniutek wants to merge 1 commit intoJSONAPI-Resources:masterfrom
beniutek wants to merge 1 commit intoJSONAPI-Resources:masterfrom
Conversation
beniutek
commented
Jan 19, 2017
| options[:controller] ||= @resource_type | ||
| options.merge!(res.routing_resource_options) | ||
| options[:path] = format_route(@resource_type) | ||
| options[:path] = format_route(options[:path] || @resource_type) |
Author
There was a problem hiding this comment.
if :path options is not set in routes.rb, it takes the @resource_type to formatter to form the name for the path
|
Any chance of this getting merged in? I would find this useful so that we can abstract out some of the class-structure details in our project that we hope to refactor in the future. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
previously when generating routes in rails app and using path option like this:
the generated routes from rake routes:
now when we specify this option
helpers stay the same, only url path changes
if path option is not specified or is
nilthen routes generated make use of the@resource_typeas beforeI was under impression that we want to generate and handle routes in similar fashon as in
http://guides.rubyonrails.org/routing.html#translated-paths
that's why im making this change