Steve
0
Q:

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
0

New to Communities?

Join the community