Election results in the London Borough of Sutton.
25'ten fazla konu seçemezsiniz
Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
|
- require 'rubygems'
- require 'sinatra'
- require 'pat'
- require 'dm-core'
- require 'dm-validations'
- require 'dm-timestamps'
- require 'lib/models'
-
- DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/db.sqlite3")
- DataMapper.auto_upgrade!
-
- get '/' do
- @wards = Ward.all
- haml :home
- end
-
- get '/wards/:id' do
- @ward = Ward.get(params[:id])
- @candidates = Councilcandidate.all( :ward_id => @ward.id )
- haml :wards
- end
-
- get '/wards' do
- @postcode = params[:postcode].strip.upcase
- result = Pat.get(@postcode)
- @district_name = result['administrative']['district']['title']
- @ward_name = result['administrative']['ward']['title']
- haml :wards
- end
-
- get '/how-the-election-works' do
- haml :election
- end
-
- # get '/voting' do
- # haml :voting
- # end
-
- get '/about' do
- @accounts = %w{
- adrianshort
- mashthestate
- openlylocal
- openelection
- lbsuttonnews
- stef
- stonecothill
- sutmoblib
- mysociety
- pezholio
- stonecotparking
- }
- haml :about
- end
|