I take no credit for this. This code was from Fernando Villalobos, following his tutorial on how React works with a Rails app. You can follow and read through the tutorial at https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers
- NOTE I did find an issue at the very end of the tutorial. It should be ReactDOM.findDOMNode() NOT React.findDOMNode() It drove me insane when I was following along and I could not get it to work.