How to get ActiveAdmin to work with Strong Parameters?

后端 未结 6 1618
鱼传尺愫
鱼传尺愫 2020-12-13 02:01

Update: this question was asked before there was a solution for it already in ActiveAdmin. As Joseph states, the ActiveAdmin documentation now contains this information,

6条回答
  •  醉话见心
    2020-12-13 02:20

    Update to the latest inherited_resources gem and do this in your controller block:

    ActiveAdmin.register Blog do
      #...
      controller do
        #...
        def permitted_params
          params.permit(:blog => [:name, :description])
          # params.permit! # allow all parameters
        end
      end
    end
    

提交回复
热议问题