Hi,
I’ve been using many routers to separate routing logics. This means that my router looks like this:
defmodule AccentApi.Router do
use AccentApi.Web, :router
scope "/", AccentApi do
forward "languages", Routers.Languages
end
end
And my Routers.Languages looks like:
defmodule AccentApi.Routers.Languages do
use AccentApi.Web, :router
scope "/", AccentApi do
get "/", LanguageController, :index
get "/:language_id", LanguageController, :show
end
end
Problem is, when using the AccentApi.Routers.Languages.Helper.language_path(:show, 1), the result is "/1". This is because the scope is "/" and the actual route "/languages/1" is catched by the forward function in the main Router.
Is their an easy way to use route helpers with forwarded routes? Or am I doing something wrong?
Thanks!