2006-12-27
Excluding column names from a listing
关键字: railsUsually, it is better to make your own view instead of using the
scaffold, but sometimes it's easier just to use the scaffolding.
What I did was override the content_columns method. Just take the
source:ruby 代码
- def content_columns
- @content_columns ||= columns.reject { |c| c.primary || c.name =~
- /(_id|_count)$/ || c.name == inheritance_column }
- end
And add the column names you want to exclude in the regex with _id and
_count.
发表评论
- 浏览: 37195 次
- 性别:


- 详细资料
搜索本博客
最近加入圈子
最新评论
-
研究生监考
SVN还是还能有用的啊,你还没有进行程序开发的版本控制么
-- by kayo -
一个简单的RST实例
proper 写道使用 Rest 的方式的话,是不是这段http://127.0 ...
-- by 李超群 -
一个简单的RST实例
使用 Rest 的方式的话,是不是这段http://127.0.0.1:3000 ...
-- by proper -
Editplus编辑Rubby
不懂ruby,不过你可以去找找ruby.acp,或自己创建一个,自动完成代码,格 ...
-- by winhkey -
eclipse安装插件(以安装 ...
放在eclipse目录中的话,用相对路径就可以了 path=language ...
-- by winhkey






评论排行榜