Created
May 9, 2019 15:13
-
-
Save zprima/d77ac98d7df6ccefe001932e66fa1ed2 to your computer and use it in GitHub Desktop.
medium_p8_c3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LocationsController < ApplicationController | |
def index | |
locations = Location.page(params[:page]) | |
render_json(serializer, locations) | |
end | |
def show | |
location = Location.find params[:id] | |
render_json(serializer, location) | |
end | |
private | |
def serializer | |
LocationSerializer | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment