Tag Archives: concept

Rails: model conception

You should create new model for each table:
rails generate model Tank

it'll create migration Tanks, you should open db/migrate/${date}_create_tanks.rb

and put there definition of table

After you should open modelĀ  app/models/tank.rb

and put there tables relations.

After creating models you should use RAILS_ENV=development rake db:migrate for creating database with tables and relations between the last one