codeforgreensboro.org
This is the marketing and information site for Code for Greensboro, the Code for America Brigade for the city of Greensboro, NC.
Ruby on Rails is fast, easy to learn, and fits well with the project landscape of Code for America. This application should probably run without a model, or with a very minimal model for page content. We handle static pages with High Voltage, which allows us to keep Rails conventions like layouts and views but without the overhead of a dedicated Pages controller.
- Uses SASS for CSS processing
- Uses Bourbon, Neat and Bitters for mixins, grids, responsive presentation and to manage sane defaults
- Uses Font Awesome for quick icon goodness
Since a lot of the site is static or mostly static pages, we're using High Voltage to make this easier.
The essential part of High Voltage is:
Write your static pages and put them in the RAILS_ROOT/app/views/pages directory.
$ mkdir app/views/pages
$ touch app/views/pages/about.html.erb
After putting something interesting there, you can link to it from anywhere in your app with:
link_to 'About', static_path('about')
You can nest pages in a directory structure, if that makes sense from a URL perspective for you:
link_to 'Q4 Reports', static_path('about/corporate/policies/HR/en_US/biz/sales/Quarter-Four')
Bam.
- You should have Ruby installed, as well as Rails
- Clone this repository
- Run bundle install
- Make your changes
- Submit a pull request
- Literally save the world
If you get stuck, send us a message on Slack.
If you don't want to install Postgresql locally you can use Docker.
docker run -p 8080:5432 --name cfgso-postgress -e POSTGRESS_PASSWORD=password -d postgres
# Update the database.yml password and port to match your password and port
rake db:create
# Or RAILS_ENV=production rake db:create
bin/rails s -e production
wget -r -l inf -k -nc -nH -p -E -e robots=off -P ./static_codforgreensboro.org http://localhost:3000