From 6d7a1273766ef2baeb3cb8357420040973fca653 Mon Sep 17 00:00:00 2001 From: Pablo Brasero Date: Thu, 5 Dec 2019 16:28:35 +0000 Subject: [PATCH] More in line with the existing APIs --- .../dashboard/templates/controller.rb.erb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/generators/administrate/dashboard/templates/controller.rb.erb b/lib/generators/administrate/dashboard/templates/controller.rb.erb index cfb19fc731..09e230ba7e 100644 --- a/lib/generators/administrate/dashboard/templates/controller.rb.erb +++ b/lib/generators/administrate/dashboard/templates/controller.rb.erb @@ -31,14 +31,13 @@ module <%= namespace.classify %> # Override `resource_params` if you want to transform the submitted # data before it's persisted. For example, the following would turn all - # empty values into nil values: + # empty values into nil values. It uses other APIs such as `resource_class` + # and `dashboard`: # # def resource_params - # params.require(resource_name) - # .permit(dashboard_class::FORM_ATTRIBUTES) - # .transform_values do |value| - # value == "" ? nil : value - # end + # params.require(resource_class.model_name.param_key). + # permit(dashboard.permitted_attributes). + # transform_values { |value| value == "" ? nil : value } # end # See https://administrate-prototype.herokuapp.com/customizing_controller_actions