Path helper with custom path

needed to add an extra route called refresh which I added to my router under the sites resource`

resources "/sites", SiteController do
   resources "/users", UserController
   get "/refresh", UserController, :refresh, as: :refresh
end

However when I use the path helper it says only the normal actions such as :create, :index, etc are supported and it can’t find the :refresh route.

  <= link "Refresh", to: Routes.site_user_path(@conn,  :refresh, @conn.assigns.site) %>

Tips on how to get this working would be appreciated.

That’s because you are calling the wrong path helper (site_user_path). Run mix phx.routes to list all the routes in your application. I think you are looking for the site_refresh_path helper.

perfect, thank you!

I forgot about that task to print routes.