Use Rails' :as
option to name path helpers.
#37
kstevens715
started this conversation in
Ideas
Replies: 1 comment
-
Hi Kyle! I like this proposal, if you come up with a way to obtain the original Unfortunately, Perhaps this could be implemented using a new |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The following routes are a slight modification to the routes file checked into this repo.
Currently, these two routes only produce a single path helper because routes with the same
action
are uniqued.js_from_routes
could produce helpers for both routes if it made use of Rails':as
option. This makes a lot of sense to me because that is the way Rails provides to make custom names for the path helpers inside of Rails. This would allow those same path helpers to be exposed to JS.Using the
:as
option to name the helpers would probably be good even outside of this example that currently causes a path helper to not get produced.Given the above Rails routes, I would expect the exported JS path helpers to be something like:
Beta Was this translation helpful? Give feedback.
All reactions