Skip to content

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

@greysteil

Description

@greysteil

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions