Route with two controllers

I would like to have the following routes that whenever a visitor access a generated slug for both a user and an event, it should redirect to the specific page for the user or event.

  get '/:id', to: 'users#show'
  get '/:id', to: 'events#show'

The current issue is whenever I visit the event page via the new route, it gives me an error to the users controller that the slug was not found. Any workaround for this?

0 Comment

NO COMMENTS

LEAVE A REPLY

Captcha image