An active engineer explains how to generate a model with Rails [for beginners]
Learn how to generate a model in Rails.
If you're not familiar with Ruby in the first place, you can read the article that explains what Ruby is for a deeper understanding.
This article is based on the contents of the Ruby course of TechAcademy's online boot camp.
What is a Rails model?
A model is a mechanism for manipulating information in a database.Normally, in order to operate a database, it is necessary to write and execute SQL statements in RDBMS.
In Rails, there is a mechanism called Active Record to make it easier to handle the database, and each model can operate the database through Active Record.
How to generate a model
Follow the steps below to generate a model.
- rails generate…