- It uses rails to include only JS and Webpack compiled files which was perfect match for the use case.Figuring solutions is always easy, The difficult part is to figure out the problemReact_on_rails has given the instructions to setup existing rails project so I started with them but ran into many…
- In this particular case, figuring out the problem became worse as the errors were misleading.The Aha Moment: Devil was in the detailsFinally to figure out the problem I created a sample project from scratch using react_on_rails new project setup instructions and started comparing the generated code with my existing project.
- This particular information turned out to be crucial to get out of the problem I was facing which I was not aware of at that time.SolutionTo solve this issue just change your API controller to base controller.
- Though I would suggest to convert your entire rails-5 api only app to normal rails app.
- Once you have resolved everything run$bundle installThis will convert your rails-5 API only app to rails app which can easily be integrated with react_on_rails.
Integration of react and rails using react_on_rails gem in an existing rails-5 api only project
Continue reading “Rails, React and me – codeburst”