Question: Now i am making React app on top off Ruby on Rails app (with out react-rails gem) by using [browserify-rails](https://github.com/browserify-rails/browserify-rails) to compile js files.

So i tried to us [react-router](https://github.com/ReactTraining/react-router) to config router of the app

This is my main.js

```
import React from 'react';
import ReactDOM  from 'react-dom';
import { Router, Route } from 'react-router';
import { browserHistory } from 'react-router';

/*Import Component*/

import DashBoard from './components/dashboard';
import Group from './components/dashboard';

/*
 *
 * Routes
 *
 * */

var routes = (
    <Router history={browserHistory}>
        <Route path="/" component={DashBoard}/>
        <Route path="/group" component={Group}/>
    </Router>
);

ReactDOM.render(routes , document.querySelector('#main'));

```

But when i go to 

```
http://my.app.dev/group

```

I got 

```
No route matches [GET] "/group" (From Rails)

```

So how can i fix this and make React Router on top off Rails router?

Thanks!

Answer: 
If you want to redirect all your request to single page, that's easy:

```
# config/routes.rb 

root 'dash_board#index'
get '*path', to: 'dash_board#index'

```

If Rails will render your React components on DashBoard#index page, React's router will intercept it from there.
It might be 2 years later, but I believe I'm not the only one having this issue nowadays, so here's un updated answer that actually helped.

Instead of only defining a redirect from `*path`, to a desired route, a `constraints` parameter must be provided so requests for resources (css, js, etc.) don't get 406 responses:

```rb
get '*path', to: "home#index", constraints: ->(request) do
  !request.xhr? && request.format.html?
end

```

I found the solution [here](https://ligcreative.com/react-rails-api-part-3-router/).