我现在有一个由ActiveScaffold生成的通用列表。在列表中每一行的末尾,ActiveScaffold为每条记录添加标准CRUD链接Show、Edit、Delete。
/foo/show/[id]
-我的ActiveScaffold配置中有这个:
config.show.link.action = "show"
config.show.link.parameters = {:controller => "foo", :id => ???}
身份证件
参数。我试过使用fooôid或fooôid之类的东西,但是控制器不知道它们是什么。例如,当我使用:foo_id时,我只得到字符串-
/foo/show/foo_id
.
class MessagesController < ApplicationController
active_scaffold :messages do |config|
config.columns = [:eff_date, :exp_date, :type, :message]
config.show.link.action = "show"
config.show.link.parameters = {:controller => "show_messages", :id => ??}
end
end
我想继续使用ActiveScaffold作为列表屏幕,因为我不想滚动自己的列表版本。我在google上发现一个人也在问同样的问题,但没有人回应。
http://www.mail-archive.com/activescaffold@googlegroups.com/msg00798.html
编辑:我应该补充一点,不指定:id参数实际上会将默认的ActiveRecord id放在字段中,但它并不是我想要的那样——再说一遍,说来话长。。。:(