# Rails 2.2 - Getting started - need some help

**URL:** <https://www.ruby-forum.com/t/rails-2-2-getting-started-need-some-help/162177>\
**Category:** Rails\
**Created:** [March 6, 2009, 1:46pm UTC](https://www.ruby-forum.com/t/rails-2-2-getting-started-need-some-help/162177 "2009-03-06T13:46:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johan-vm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c77e96/32.png) [@johan-vm](https://www.ruby-forum.com/u/johan-vm)\
**Post date:** [March 6, 2009, 1:46pm UTC](https://www.ruby-forum.com/t/rails-2-2-getting-started-need-some-help/162177/1 "2009-03-06T13:46:09Z")

</div>

Hi,

I’ve used ROR in the past,  
but recently started working with version 2.2.

I don’t seem to be able to get started:

# I create a rails app: @rails music\_library@

# I create a db using an SQlite gui: @music\_library\_DB.rsd@

# I edit the config/database.yml file:

@development:  
adapter: sqlite3  
database: db/music\_library\_DB.rsd  
pool: 5  
timeout: 5000@  
#I run @script/generate scaffold Album@  
#I run @rake db:migrate@

Afterwards, I run @script/generate migration columns@, so I can add  
columns to the @albums@ DB table:

# @class Columns \< ActiveRecord::Migration

def self.up  
drop\_table :albums  
create\_table :albums do |t|  
t.string :title, :artist, :genre  
t.datetime :releasedate  
t.timestamps  
end  
end

def self.down  
drop\_table :albums  
end  
end@

# I run @rake db:migrate@ again, to execute the migration

And here’s my question:

How do I update the scaffolding, so I can use CRUD to add albums, …

---

<div class="post-metadata">

**Author:** ![johan-vm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c77e96/32.png) [@johan-vm](https://www.ruby-forum.com/u/johan-vm)\
**Post date:** [March 6, 2009, 1:48pm UTC](https://www.ruby-forum.com/t/rails-2-2-getting-started-need-some-help/162177/2 "2009-03-06T13:48:16Z")

</div>

Sorry, I thought this forum could understand Textile…

Here we go again:

Hi,

I’ve used ROR in the past,  
but recently started working with version 2.2.

I don’t seem to be able to get started:

1/ I create a rails app: rails music\_library  
2/ I create a db using an SQlite gui: music\_library\_DB.rsd  
3/ I edit the config/database.yml file:

development:  
adapter: sqlite3  
database: db/music\_library\_DB.rsd  
pool: 5  
timeout: 5000

4/I run script/generate scaffold Album  
5/I run rake db:migrate

Afterwards, I run script/generate migration columns, so I can add  
columns to the albums DB table:

class Columns \< ActiveRecord::Migration  
def self.up  
drop\_table :albums  
create\_table :albums do |t|  
t.string :title, :artist, :genre  
t.datetime :releasedate  
t.timestamps  
end  
end

def self.down  
drop\_table :albums  
end  
end

I run rake db:migrate again, to execute the migration

And here’s my question:

How do I update the scaffolding, so I can use CRUD to add albums, …

---

<div class="post-metadata">

**Author:** ![johan-vm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c77e96/32.png) [@johan-vm](https://www.ruby-forum.com/u/johan-vm)\
**Post date:** [March 6, 2009, 3:05pm UTC](https://www.ruby-forum.com/t/rails-2-2-getting-started-need-some-help/162177/3 "2009-03-06T15:05:24Z")

</div>

You don’t. Dynamic scaffolding was deprecated after Rails 1.2.x, I  
believe. Rails 2.0 and beyond actually generate the view files as ERB  
depending on the model attributes you provide on the command line to  
create  
the scaffold.

The preferred way to create a new scaffold now will look something like  
this:

```
ruby script/generate scaffold Album title:string artist_name:string

```

release\_year:integer …

This creates a new resource with all the extra REST-ful stuff that comes  
along with it.

If you want to try installing the old dynamic scaffolding as a plugin,  
it’s  
still available (ruby script/plugin install scaffolding should do it),  
but  
it’s questionable whether or not it will work with any newer version of  
the  
framework.

On Fri, Mar 6, 2009 at 1:48 PM, Johan Van mol \<
