通过活动管理员进行即时编辑时,数据不会更改

时间:2016-04-18 09:16:57

标签: ruby-on-rails ruby ruby-on-rails-4 activeadmin

当我尝试通过主动管理

编辑类别标题时,数据不会更改

这是我的admin / category.rb

ActiveAdmin.register Category do


permit_params :list, :of, :attributes, :on, :model,:title

controller do
 def permitted_params
   params.permit post: [:title]
 end
 end

end 

1 个答案:

答案 0 :(得分:3)

希望下面的内容同样适用。

ActiveAdmin.register Category do
permit_params :category, :title
end 

对于覆盖params hash,您可以使用如下

ActiveAdmin.register Category do
  #...
  controller do
    #...
    def permitted_params
      params.permit(:category => [:name])
      # params.permit! # allow all parameters
    end
  end
end