1) Using string concatenation:
The easiest way to create an API in Rails and get it up and running is creating it with scaffold and testing it with Mini Test.
React (sometimes called React.js or ReactJS) is an open-source JavaScript library providing a view for data rendered as HTML.
In javascript, functions are first-class objects, and they can be used in a first class manner like any other object(arrays, strings, numbers, etc). They can be stored as variables, passed as arguments to functions.