Skip to content

Instantly share code, notes, and snippets.

@adamdilek
Created November 29, 2011 22:20
Show Gist options
  • Save adamdilek/1406839 to your computer and use it in GitHub Desktop.
Save adamdilek/1406839 to your computer and use it in GitHub Desktop.
Adress
class Services::AddressController < ApplicationController
respond_to :html, :xml, :json
def index
end
def provinces
@provinces=Province.all
respond_with(@provinces)
end
def counties
@province=Province.find(params[:province])
@counties=@province.counties
respond_with([@counties])
end
def regions
@county=County.find(params[:county])
@regions=@county.regions
respond_with(@regions)
end
def street_villages
@region=Region.find(params[:region])
@street_villages=@region.street_villages
respond_with(@street_villages)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment