Skip to content

Commit

Permalink
Document resource_params
Browse files Browse the repository at this point in the history
  • Loading branch information
pablobm committed Dec 19, 2019
1 parent 5988043 commit 3ea91ed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/generators/administrate/dashboard/templates/controller.rb.erb
Expand Up @@ -29,6 +29,18 @@ module <%= namespace.classify %>
# end
# end

# 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:
#
# def resource_params
# params.require(resource_name)
# .permit(dashboard_class::FORM_ATTRIBUTES)
# .transform_values do |value|
# value == "" ? nil : value
# end
# end

# See https://administrate-prototype.herokuapp.com/customizing_controller_actions
# for more information
end
Expand Down

0 comments on commit 3ea91ed

Please sign in to comment.