Class: Addresses::NeighborhoodsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/addresses/neighborhoods_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



7
8
9
10
# File 'app/controllers/addresses/neighborhoods_controller.rb', line 7

def index
  @neighborhoods = Neighborhood.where(city_id: params[:city_id])
  render json: @neighborhoods
end

#showObject



12
13
14
15
# File 'app/controllers/addresses/neighborhoods_controller.rb', line 12

def show
  @neighborhood = Neighborhood.find(params[:id])
  render json: @neighborhood
end