开发者

How to create database migrations in Ruby on Rails without Using Scaffolding

I want to create the Model and everything on my own without using the scaffolding in Ruby on Rails. I create the following class:

class Dog < ActiveRecord::Base 

end 

Now, I want to add a开发者_JAVA百科 table Dogs. I am using sqlite3. I think I need to write migration manually!


Rails 2:

ruby script/generate migration CreateDogs

Rails 3:

rails g migration CreateDogs

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜