Commit f1d44384 by ivan Lan

Improve the extended mode of resource_params

parent 1dbaa1bd
...@@ -118,14 +118,13 @@ module Shotengai ...@@ -118,14 +118,13 @@ module Shotengai
@resource = default_resources.find(params[:id]) @resource = default_resources.find(params[:id])
end end
# If you want to add custome columns, you can do just like:
# def resource_params
# super.merge params.require(:some_key)
# end
def resource_params def resource_params
params.require(resource_key).permit!.merge other_resource_params params.require(resource_key).permit!.merge other_resource_params
end end
# rewrite this to add more custom column
def other_resource_params
params.require(resource_key).permit!
end
end end
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment