开发者

How does one make models in Rails?

I've gone over the tutorial, used the scaffold command to make a model, etc.

I noticed that it mentioned more experienced programmers would probably create all their models from scratch... What is the "appropriate" way to do so?

If it's a simple answer and I'm just Googlin' the开发者_StackOverflow中文版 wrong keywords, I apologize in advance.


Open your text editor to app/models/modelname.rb and start typing. :)

Until you're that good though, script/generate model <modelname> is there for you: http://en.wikibooks.org/wiki/Ruby_on_Rails/Built-In_Rails_Tools/Generators


ruby script/generate model model_name

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜