Check out example codes for "lewagon rails template". It will help you in understanding the concepts better.
Code Example 1
rails new \
--database postgresql \
--webpack \
-m https://raw.githubusercontent.com/lewagon/rails-templates/master/devise.rb \
CHANGE_THIS_TO_YOUR_RAILS_APP_NAME
Learn ReactJs, React Native from akashmittal.com