1

我想做类似的事情:

project_paths = project_hash.keys
delegate :params, :h, :raw, :link_to, project_paths, to: :@view

butproject_paths是一个数组,在这里不起作用。

如何将一组符号转换为可以输入的逗号分隔符号的“列表” delegate

4

1 回答 1

5

使用 splat 运算符:

delegate :params, :h, :raw, :link_to, *project_paths, to: :@view
于 2012-10-29T01:26:36.233 回答