本文介绍了为什么 Ruby on Rails 弃用了脚手架方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在学习 Ruby on Rails,所以我相信我迟早会发现这一点.
I am learning Ruby on Rails so I'm sure I'll find this out sooner or later.
为什么在 Rails 版本 2 中不推荐使用脚手架方法?
Why would the scaffold method be deprecated in version 2 of Rails?
推荐答案
脚手架方法违背了脚手架的精神,脚手架旨在为您提供一个起点,您应该根据自己的需要在此基础上进行构建.通过动态生成脚手架,您无需编辑任何内容.
The scaffold method went against the spirit of scaffolding, which is meant to give you a starting point that you are supposed to build upon for your own needs. By generating the scaffold dynamically, there is nothing for you to edit.
脚手架生成器的新方法让您可以编辑脚手架文件,以便您可以使用它来构建您实际需要的内容.
The new way with the scaffold generator lets you edit the scaffolded files so you can use it to build what you actually need.
这篇关于为什么 Ruby on Rails 弃用了脚手架方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!