2008-07-01

rails魔术字段的实现 ,alias_method_chain用法

关键字: rails, alias_method_chain
Encapsulates the common pattern of: alias_method :foo_without_feature, :foo alias_method :foo, :foo_with_feature With this, you simply do: alias_method_chain :foo, :feature 替我们定义了两个方法:foo_with_feature 和 foo_without_feature <保存原来的foo方法> def foo_with_feature 在此添加想向foo方法里面写的代码 foo_with ...
xu_wccq
搜索本博客
我的相册
Ac7ad940-edbc-3b23-8443-5fe2ea338061-thumb
productcenter.bmp
共 2 张
最近加入圈子
存档
最新评论