You can also specify all the URLs you need in Router manually in route.rb, redirecting them to the rails controller using Router, say / home:
# config/routes.rb Rails.application.routes.draw do root action: :index, controller: 'home' get 'url1', action: :index, controller: 'home' get 'url2', action: :index, controller: 'home' get 'url3', action: :index, controller: 'home' end
Note that your underlying React component will use Router to use the corresponding component if you have something like:
<Route path="/url1" component={ ComponentForUrl1 } /> <Route path="/url2" component={ ComponentForUrl3 } /> <Route path="/url3" component={ ComponentForUrl2 } />
Borzh source share