I decided to create an e-commerce style app using Javascript(JS) on the frontend and Ruby on Rails(RoR) for the backend. While using RoR on the backend, I decided to create two methods, instance_to_json and self.array_to_json, inside the Product model to better shape how the data from the JSON would return…