Forum: Ruby on Rails Wrong number of arguments (2 of 0)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Thierry D. (Guest)
on 2008-10-24 20:37
I'm new with RoR.
I have a simple migration file:
class CreateClubs < ActiveRecord::Migration
  def self.up
    create_table :clubs do |t|
        t.columns :name, :string
      t.columns :ref, :string
      t.columns :description, :string
      t.columns :local, :string

      t.timestamps
    end
  end

  def self.down
    drop_table :clubs
  end
end

But I get this error message:

[..]
Wrong number of arguments (2 of 0)
./db/[..].rb:4:in 'columns'
[..]

What am I missing?
Thank you for your help.
Thierry D. (Guest)
on 2008-10-24 20:40
Juste before trying to migrate thie table clubs, I did it fine with
league:

class CreateLeagues < ActiveRecord::Migration
  def self.up
    create_table :leagues do |t|
      t.columns :name, :string
      t.columns :ref, :string
      t.columns :description, :string
      t.columns :category, :string

      t.timestamps
    end
  end

  def self.down
    drop_table :leagues
  end
end
Philip H. (Guest)
on 2008-10-24 21:30
(Received via mailing list)
On Oct 24, 2008, at 9:40 AM, Thierry D. wrote:

>      t.columns :category, :string
Shouldn't that be "t.column"? (no 's').  Or maybe even...

t.string :name
....
This topic is locked and can not be replied to.