School Discovery App
The School Discovery App is designed to help parents 1) identify the schools to which their children are eligible to apply and 2) understand the odds of their children getting admitted. To search for schools, parents enter an address and a grade level. The search engine logic works as follows:
- if no parameters are entered -> display a blank map and a welcome note (the default page)
- if a grade level and no address are entered -> display the default page with an alert message
- if a grade level and non-geocodeable address are entered -> display the default page with an alert message
- if a grade level and non-Boston address are entered -> display the default page with an alert message
- if a grade level and valid address are entered -> display the walk zone and assignment zone schools for that address
- if high school and a valid address are entered -> display the walk zone schools and all of the other high schools throughout the city
git clone email@example.com:schoolselection.git
there are a couple of obstacles to hosting this app on heroku.
1) You need to have a postgis-enabled database, which means that you need to have a private Heroku database, set up with "heroku addons:add heroku-postgresql postgis=true". Then promote it to your database with "heroku pg:promote" 2) When pushing with "heroku db:push", the taps gem doesn't recognize the postgis type. You need to temporarily change your config/database.yml file to have the adapter read "postgres" (not "postgis"). You also need to change heroku's DATABASE_URL to postgres using "heroku config:add DATABASE_URL=postgres://..." 3) taps doesn't seem to preserve geographic column type. You'll need to go into "heroku pg:psql" and run:
ALTER TABLE parcels ALTER geometry TYPE Geography('MULTIPOLYGON',-1) USING ST_GeogFromText(geometry); ALTER TABLE assignment_zones ALTER geometry TYPE Geography('MULTIPOLYGON',-1) USING ST_GeogFromText(geometry);
RGeo spatial adapter needs the adapter name set to 'postgis' to load. you accomplish this by setting the heroku DATABASE_URL. run "heroku config", and look at DATABASE_URL NEW_URL is the existing DATABASE_URL, but with postgres:// replaced with postgis:// run "heroku config:add DATABASE_URL=NEW_URL", where NEW_URL is your current database url
Run 'heroku restart', to make sure your app loads the database correctly.
[step 0 not necessarily applicable] [0.1 heroku db:pull*] [0.2 psql -d , \d