Check out example codes for "rails api only with postgress and rspec". It will help you in understanding the concepts better.

Code Example 1

rails new app-name --api -T -d postgresql

Learn ReactJs, React Native from akashmittal.com