def rest(path, params)
      endpoints = (params.delete(:only) || [:index, :show, :create, :update, :destroy]).to_a
      endpoints = endpoints - params.delete(:except).to_a
      endpoints.each do |endpoint|
        self.send(('restful_' + endpoint.to_s).to_sym, path, params)
      end
    end
def rest(path, params)
      endpoints = (params.delete(:only) || [:index, :show, :create, :update, :destroy]).to_a
      endpoints = endpoints - params.delete(:except).to_a
      endpoints.each do |endpoint|
        self.send(('restful_' + endpoint.to_s).to_sym, path, params)
      end
    end
Create rest endpoints