# Commands to set up project ( including model & controller)

**URL:** <https://www.ruby-forum.com/t/commands-to-set-up-project-including-model-controller/108978>\
**Category:** Rails\
**Created:** [July 10, 2007, 7:41am UTC](https://www.ruby-forum.com/t/commands-to-set-up-project-including-model-controller/108978 "2007-07-10T07:41:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unnikrishnanes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/ce73a5/32.png) [@unnikrishnanes](https://www.ruby-forum.com/u/unnikrishnanes)\
**Post date:** [July 10, 2007, 7:41am UTC](https://www.ruby-forum.com/t/commands-to-set-up-project-including-model-controller/108978/1 "2007-07-10T07:41:14Z")

</div>

Create Project

> rails project\_name

change directory to ‘project\_name’

project\_name\> ruby script/server

create 3 Databases

databasename\_development  
databasename\_test  
databasename\_production

open database.yml in config folder and give the database details. I  
think , you only have to give the password.

next, you have to create model

project\_name\> ruby script/generate model Model\_name

edit /db.migrate/001\_create\_modelnames

add commands for creating table

## for ex:-

## def self.up create\_table :classifieds do |t| t.column :title, :string t.column :price, :float t.column :location, :string t.column :description, :text t.column :email, :string t.column :created\_at, :timestamp t.column :updated\_at, :timestamp end

then, execute this against database

projet\_name\> rake migrate

next, creating controller

project\_name\> ruby script/generate controller Controller\_name
