Commit d2218343 by liyijie

feat: refector resource & build_resource method

parent 8a6d6f8c
...@@ -377,6 +377,14 @@ class SimpleController::BaseController < ::InheritedResources::Base ...@@ -377,6 +377,14 @@ class SimpleController::BaseController < ::InheritedResources::Base
association association
end end
def resource
get_resource_ivar || set_resource_ivar(after_of_association_chain.send(method_for_find, params[:id]))
end
def build_resource
get_resource_ivar || set_resource_ivar(after_of_association_chain.send(method_for_build, *resource_params))
end
def collection def collection
get_collection_ivar || set_collection_ivar( get_collection_ivar || set_collection_ivar(
paginate_association_chain, paginate_association_chain,
......
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