You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. Is there a way to pass additional arguments to search scope. Here is example that I'm looking for:
classClientclass << selfdefransackable_scopes(_auth_object=nil)%i(filter_by_status)enddeffilter_by_status(status,context)casestatuswhen'all'where(nil)when'closed'where(%("status" == 'closed' OR id IN (:open_ids)),status: context[:user].try(:open_ids) || [])endendendendclassClientsControllerdefindex@q=Client.search(params[:q],context: {user: current_user})# `context` or `additional_params` or `whatever`@clients=@q.resultendend
So I may pass additional argument from controller which I may use in scope.
The text was updated successfully, but these errors were encountered:
This issue appears more to be a HOW-TO issue rather than a bug in Ransack. We are in the process of cleaning up the Ransack gem and repo. If this issue is still relevant could you please ask it on StackOverflow?
If you think it is an issue with Ransack, please provide a repo with the issue and / or a pull request with failing tests. If you don't know how to do this, indicate it in the issue and we will look into it eventually.
Hi. Is there a way to pass additional arguments to search scope. Here is example that I'm looking for:
So I may pass additional argument from controller which I may use in scope.
The text was updated successfully, but these errors were encountered: