You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 19, 2018. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 19, 2018. It is now read-only.
The ideal would be to access Rails route helpers verbatim just as you would in backend views or helpers. But the routing code is pretty tangled so I think it won't be possible to run it directly on the frontend without effort.
A workaround is to add .erb to component files and interpolate the route on the backend with static placeholder values, then gsub in real values on the frontend.
Using positional arguments is the easiest, but if your route contains numbers it won't work so explicitly name your arguments with placeholders that won't clash. The above example shows both.
Activity
catmando commentedon Nov 15, 2017
I'm closing this, and moving it hyper-config, and also requesting documentation copy the good solution proposed above.