Election results in the London Borough of Sutton.
25개 이상의 토픽을 선택하실 수 없습니다.
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- require 'rubygems'
- require 'sinatra'
- require 'json'
- require 'rest_client'
-
- get '/' do
- @wards = %w{ Cheam Sutton Stonecot }
- haml :home
- end
-
- get '/wards' do
- @postcode = params[:postcode].strip.upcase
-
- url = "http://www.uk-postcodes.com/postcode/" + @postcode.gsub(/ /, '') + '.json'
-
- result = RestClient.get(url)
- result_ary = JSON.parse(result)
- @district_name = result_ary['administrative']['district']['title']
- @ward_name = result_ary['administrative']['ward']['title']
- haml :wards
- end
-
|