Skip to content

Commit

Permalink
More in line with the existing APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
pablobm committed Dec 5, 2019
1 parent 3470e85 commit cf6f039
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cf6f039

Please sign in to comment.