DEV Community

Discussion on: Building and Consuming a JSON API with Rails and React

Collapse
 
johnfajardo profile image
John Fajardo • Edited

Why use a gem for json instead of using the --api flag when creating the new rails project?

Collapse
 
kattyacuevas profile image
Kattya Cuevas

It's because I am building a web application which included an API inside. With the --api flag, I lose the initial configuration to render HTML views.

I did that instead of having 2 separated applications because I prefer to handle the routes with Rails, and after that, load the correct React application.