使用带有多个=>的collection_select获取未经许可的参数真正

时间:2018-02-13 05:15:26

标签: ruby-on-rails collection-select

Console and the view

我有两个模型,它们之间没有关联。我正在获取名称列表作为选择主要模型的选项。 Collection_select没有多个=>真的按预期工作。但是当我添加多个时,我得到了未经许可的参数错误。

1 个答案:

答案 0 :(得分:0)

因为add_filter('woocommerce_is_purchasable', array($this, 'pn_hide_add_to_cart_button'), 10, 2); 是一个数组,所以你需要允许它作为一个数组。

:conf_string

BaseTablesController

请勿忘记将def base_table_params params.require(:base_table).permit(:name, conf_string: []) end 更新为:conF_string。我认为你犯了打字错误