Commit f0f9e538 by liyijie

Add after_association_chain method to collection

parent cfb6c84b
...@@ -45,7 +45,17 @@ class SimpleController::BaseController < ::InheritedResources::Base ...@@ -45,7 +45,17 @@ class SimpleController::BaseController < ::InheritedResources::Base
end end
end end
def after_association_chain association
association
end
def collection def collection
get_collection_ivar || set_collection_ivar(end_of_association_chain.ransack(params[:q]).result.paginate(page: params[:page], per_page: params[:per_page])) get_collection_ivar || set_collection_ivar(
after_association_chain(end_of_association_chain).ransack(
params[:q]
).result.paginate(
page: params[:page], per_page: params[:per_page]
)
)
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