Summary
In this chapter, we learned about the most popular Ruby framework-Ruby on Rails. We started with the fundamentals of Ruby on Rails and the MVC pattern it's based on. We then created our first Rails application and discussed the folder structure of an application that uses Rails. We then explored the interaction between a controller and a view using Rails Action Controller and Action View. We set up our model, database, and corresponding migrations, and we learned how easy it is to set up all this with Rails Active Record.
We also learned about routes in Rails and how to set up a root route for our application. Then, we learned how to create views quickly with helper methods and we created our first form. We used this form to save data to a database and create Active Record queries that could do so, too. Similarly, we also learned how to fetch data from the database using Active Record and display the fetched data on a view with Embedded Ruby
(ERB
). Furthermore, we...