Phoenix named routes only the last part

Hi, nice to meet you. This is my first question in the forum :waving_hand:

I’m trying to develop a package for Phoenix to generate routes in typescript files to be used in my frontend which is done with Inertia.js. What I want is exactly like this Laravel package

They have two folders

  1. actions β†’ all the routes
  2. routes β†’ only named routes

In Laravel route they have a way of getting this info. If the route is named or not. Phoenix also have this info but the problem is that the named route comes in a route property called β€œhelper” but it comes with all the scope of the route. I just want the last part so methods generated in Typescript are nice and shot

More details can be found in my repo in this issue

Thanks for the help!

Welcome @andresgutgon!

  • :as - a string or atom containing the named helper scope. When set to false, it resets the nested helper scopes. Has no effect when using verified routes exclusively

So scope /some, as: false would do I guess.

1 Like