Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom URL in links? #35

Closed
mfunaro opened this issue Mar 19, 2016 · 1 comment · Fixed by #50
Closed

Custom URL in links? #35

mfunaro opened this issue Mar 19, 2016 · 1 comment · Fixed by #50
Milestone

Comments

@mfunaro
Copy link

mfunaro commented Mar 19, 2016

Is there a way to customize the links that get built?

My resource is set up in the router.ex like this...

 scope "/api", Handiman do
   pipe_through :api

   resources "/users", UserController, except: [:new, :edit, :create]
   resources "/register", RegistrationController, only: [:create]
   resources "/rounds", RoundController, except: [:new, :edit]
  end

so my URLs will look like /api/rounds but when the links are created for 'self' for example, api is not included and the URL is useless.

@mpriestman
Copy link
Contributor

I've managed to work around this by providing implementations of url_for/2 in my view that return the correct URL for the resource. It's a bit messy, but it works. Maybe there is a better way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants