metamaps--metamaps/app/controllers/api/v2/maps_controller.rb
Devin Howard 1fbfd56d57 filter maps by user_id in api (#872)
* filter maps by user_id in api

* test user_id map filter

* update starred maps example to make starred true lol

* add user id to map schema/examples
2016-10-29 22:07:27 +08:00

15 lines
329 B
Ruby

# frozen_string_literal: true
module Api
module V2
class MapsController < RestfulController
def searchable_columns
[:name, :desc]
end
def apply_filters(collection)
collection = collection.where(user_id: params[:user_id]) if params[:user_id]
collection
end
end
end
end