简体   繁体   English

有人实际使用Ruby On Rails脚手架吗?

[英]Does anyone actually use Ruby On Rails scaffolding?

I think I am missing the point of scaffolding, does anyone use RoR scaffolding and if so can they point me to any specific examples of how they use it? 我认为我错过了脚手架的要点,是否有人使用RoR脚手架?如果可以,他们是否可以向我指出如何使用RoR脚手架?

I am a big sass and compass fan, is it possible to incorporate this into scaffolding? 我是一个粗鲁的指南针迷,是否可以将其整合到脚手架中?

Yes, scaffolding as a generator is useful. 是的,将脚手架用作发电机很有用。 It creates the files you need, then you customize them. 它创建所需的文件,然后自定义它们。 I don't think anybody uses the active scaffolding anymore, I for one discourage it. 我认为没有人再使用主动式脚手架了,我为此感到灰心。 But, as I said, the generator is usesful 但是,正如我所说,生成器很有用

rails g scaffold product price:float title:string description:text

as it creates the migration file, model and controller you need either way. 当它创建迁移文件,模型和控制器时,您需要两种方式。 I don't like the default tests (rspec has better test generators) as I value tests too much to have stupid autogenerated ones. 我不喜欢默认测试(rspec具有更好的测试生成器),因为我过于重视测试,以至于没有愚蠢的自动生成的测试。

As for the sass and/or compass, I don't use generators for that, but you may try something like http://github.com/darthschmoo/rails-compass-sass-generator I don't autogenerate those as the views are always highly customized. 至于sass和/或指南针,我不使用生成器,但是您可以尝试使用类似http://github.com/darthschmoo/rails-compass-sass-generator之类的方法,但我不会自动将其生成为视图总是高度定制的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM