开发者

How does one make models in Rails?

开发者 https://www.devze.com 2023-01-06 22:20 出处:网络
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 t

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

精彩评论

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