Check out example codes for "how to create new rails app". It will help you in understanding the concepts better.

Code Example 1

#first make sure you have rails installed, then...
rails new your_new_rails_app_name

Learn ReactJs, React Native from akashmittal.com