The magic is actually quite simple: Rails uses reflection to copy controller variables into a collection, which is then copied back into the view instance.
这一机制背后的原理其实很简单:Rails首先通过反射将控制器中的变量拷贝到一个容器中,其后又将该容器中的变量拷贝回视图实例。
That's certainly not because three books is a magic number (although it is a great start!), but rather it's a reflection of the general disinterest in or even intimidation by the subject.
这当然不是因为3是个神奇的数字(虽然这已经是个很棒的开始了!)
If reflection were magic, he'd be a Magician.
如果胡思乱想也是魔法,那他已经是一个魔法师了。
应用推荐