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

Easy way to routes multiple URLs to the same action #51

Open
greysteil opened this issue Jun 14, 2018 · 1 comment
Open

Easy way to routes multiple URLs to the same action #51

greysteil opened this issue Jun 14, 2018 · 1 comment

Comments

@greysteil
Copy link
Contributor

I have an old endpoint I want to quietly combine with a new one. Here's what I tried to do:

Old router:

router.draw(
    Routes::Badges,
    base: "/badges",
    actions: [
      ci_status: { method: :get, url: "/ci_status" },
      compatibility_score: { method: :get, url: "/compatibility_score" },
    ],
  )

Attempted new router:

router.draw(
    Routes::Badges,
    base: "/badges",
    actions: [
      compatibility_score: [
        { method: :get, url: "/compatibility_score" },
        { method: :get, url: "/ci_status" },
      ],
    ],
  )

It would be rad if that worked. Any reason not to support it / preferred alternative?

@timrogers
Copy link

Hi @greysteil! 👋❤️ Sorry for the delay, I've been on holiday.

That seems reasonable to me. Looks like it shouldn't be too hard to implement either.

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

No branches or pull requests

2 participants