Check out example codes for "set default value for rails attribute". It will help you in understanding the concepts better.

Code Example 1

....
add_column :status, :string, :default => "P"
....

Learn ReactJs, React Native from akashmittal.com