Question about $ rails generate model Article


$ rails generate model Article


t.string :title
t.text :body
t.datetime :published_at

in the 20110408172635_create_articles.rb file?

And if “Yes”, why would they not show up in my editor?


Enviat des del meu iPad

El 9 Apr 2011, a les 01:11, Bruce W. [email protected] va

in the 20110408172635_create_articles.rb file?
Nope. In order to have them generated you need to specify them in the
command line:

rails g model Article title:string body:text published_at:datetime

Note that in the command line the name goes to the left of the type,
while in the modern DSL they read the other way around.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs