摘要: helper默认是只在view中可用的,如果在controller中也要使用,要在ApplicationController中 include如果model中如果有叫做type的列的话,会触发rails的Single Table Inheritance ,放弃它吧,不好用,还是安心使用外键约束吧。给model加上self.inheritance_column = nil disable它controller中的参数变量会传到对应的view中比如:def new @user = User.newend---------------------------------new.html.erb... 阅读全文
posted @ 2013-03-31 22:40 jzlikewei 阅读(261) 评论(0) 推荐(0) 编辑