views:

105

answers:

2

Hi,

I'm trying to create a rails app, but somethings going wrong, I'm getting a nasty error undefined method title' for #`

I've used this ling:

ruby script/generate scaffold Blog title:String body:text

to generate the following migration file:

class CreateBlogs < ActiveRecord::Migration
 def self.up
  create_table :blogs do |t|
    t.String :title
    t.text :body

    t.timestamps
  end
end

 def self.down
  drop_table :blogs
 end
end

Upon inspection of the database, there's no 'title' column. I've tried this with a few different names and for whatever reason, even though there's two columns along with the timestamps in the migration file, after I've run rake db:migrate there's only one field in addition to the timestamps and id. Not sure why my 'title' field isn't being created :(

+2  A: 

Shouldn't string be a lowercase 'S'?

Justin Gallagher
Yes, apparently it should. I'm such an idiot. Thanks
mac_55
A: 

You're not a lonely idiot...maybe just a java guy

k2
The other evidence is in Schema.rb, where the fields don't appear either. This is a silent failure during rake. Is there a way to light up these ignores?
k2