Answers for "pundit elasticsearch"

0

pundit elasticsearch

class MoviesController < ApplicationController
	def index
    	allowed_movies = policy_scope(Movies)
        if params[:query].present?
        	@infos = allowed_movies.search(params[:query])
        else
        	@infos = allowed_infos
        end
    end
end

# in the MoviesPolicyController :
class Scope
	#[..]
    def resolve
    	scope.all
    end
end
Posted by: Guest on November-22-2020

Browse Popular Code Answers by Language