SlideShare a Scribd company logo
From Zero to
Twitter Bootstrap & Zurb
Foundation on a Rails Backend

Stephen Cussen
for
RubyABQ
Dec 11th, 2013
the plan
•

‘from scratch’, without any previous experience,
build working rails app with bootstrap and
foundation front ends
what are the components?
•

Rails - well you all know what this is but the power
of rails was a real eye-opener for me!

•

Twitter Bootstrap …

•

Zurb Foundation …
where did I start?
•

the instruction from Michael (on the wiki):

•

1: install homebrew

•

2: install rvm

•

3: install rails

•

4: go for it!
so…
•

I installed Rails 4.0

•

new project named ‘artcards’

•

built my ‘artist’model - first name, last name,
description and small image name, large image name

•

migrated the database

•

ran the server - it worked! :-) (nothing much to show
yet)
branch
•

created a bootstrap branch from master in git

•

installed the bootstrap rails gem (show the Gemfile
on the branch - talk about less and libv8)

•

ran ‘rails g bootstrap:install’
adding images to the
database
•

moving back to the master - needed an image strategy. Chose paperclip

•

added the paperclip gem

•

ran ‘rails g paperclip artist <image_field_name>’ for a couple of image
fields

•

migrated the db

•

edited artist.rb (insert ‘has_attached_file’)

•

edited the _form.html.erb and the show.html.erb

•

And… I could select an image when I was using the form but no images in
the show artist :-(
easy to lose a few hours…
- added the paperclip gem (and installed imagemagick)
- rails generate paperclip artist small_image
- rails generate paperclip artist large_image
- rake db:migrate
- edit artis.rb
- edit _form.html.erb
- edit show.html.erb
- when adding the image - looks good - however, no image path is
stored
- Took a few hours and lots of reading to find out I needed to edit
‘artists_controllers.rb’ and add this
params.require(:artist).permit(:firstname, :lastname, :artiststatement,
:smallimagename, :largeimagename, :small_image, :large_image)
(I have a pull request in for the thouhtbot rdoc that I was working from
- paperclip README is good and covers this)
more images stuff
•

installed imagemagick on the base rails install with
paperclip and imagemagik

•

edited config/environments/development.rb to point to
imagemagik

•

edited index.html.erb to include thumb and change
heading

•

voila! (show the artists demo from master)
images to bootstrap
•

merged from master to the bootstrap branch so that
I could have all my good paperclip work and the
bootstrap work together (my first non-gui merge
prompted a call for help!)

•

on the bootstrap branch - set to work on making the
bootstrap layout ‘bootstrappy’
bootstrappy!
•

ran ‘rails g bootstrap:layout application fixed’ to
generate a bootstrap compatible layout (show
layouts)

•

voila (show the artists demo from the bootstrap
branch)
zurb foundation
•

created a ‘foundation’ branch

•

followed the super easy getting started with zurb foundation
docs (note: the rails install is under ‘Applications’)

•

using the the ‘foundation-rails’gem did the bundle and
install

•

made a couple of mods to add a grid layout and a navbar

•

and we have this (show the artists demo from the foundation
branch)
github.com/scussen

•

github.com/scussen/artcardbackend

•

‘master’ contains the base install with paperclip the art cards project and
artists application

•

the ‘boostrap’ branch contains the bootstrap gem and install, together with
the bootstrap-ized artists application

•

the ‘foundation’ branch contains the foundation gem and install, together
with the foundation-ized artists application
resources
•

getting started with rails - http://guides.rubyonrails.org/getting_started.html

•

the amazing Ryan Bates - Rails Cast #328

•

getting started with bootstrap - http://getbootstrap.com/getting-started/

•

The bootstrap rails gem doc - https://github.com/seyhunak/twitter-bootstrap-rails

•

rubyracer gem (V8 Javascript interpreter for ruby ) doc - https://github.com/cowboyd/therubyracer

•

Paperclip - early (2008) Ryan Bates - Rails Cast #134

•

paperclip doc - https://github.com/thoughtbot/paperclip

•

getting started with foundation - http://foundation.zurb.com/docs/

•

again, Ryan Bates - Rails Cast #417 - http://railscasts.com/episodes/417-foundation

•

and, what would I do without stackoverflow!

More Related Content

PPTX
Angular CLI : HelloWorld
PDF
Concourse webhook
PDF
Building a dynamic SPA website with Angular
PDF
Replacing Rails asset pipeline with Gulp
PDF
ConcourseCI love Minio
PDF
Concourse and Database
PDF
React talk, GrunnJs 24 September 2014
PPTX
habitat at docker bud
Angular CLI : HelloWorld
Concourse webhook
Building a dynamic SPA website with Angular
Replacing Rails asset pipeline with Gulp
ConcourseCI love Minio
Concourse and Database
React talk, GrunnJs 24 September 2014
habitat at docker bud

What's hot (10)

PPTX
Capybara + RSpec - ruby dsl-based web ui qa automation
PDF
Hadoop Demystified + Automation Smackdown! Austin JUG June 24 2014
PPTX
End-to-end CI/CD deployments of containerized applications using AWS services
PDF
Teaching a Designer to Use GitHub
PDF
Hipster JS: Angular & Firebase (Tri-JS Meetup)
PPTX
Deploying Web Apps with PaaS and Docker Tools
KEY
Capybara
PPTX
DevOps best practices with OpenShift
PDF
Automating Aegir Platform builds with Git; Fabric; and Drush
KEY
Ruote: A Ruby workflow engine
Capybara + RSpec - ruby dsl-based web ui qa automation
Hadoop Demystified + Automation Smackdown! Austin JUG June 24 2014
End-to-end CI/CD deployments of containerized applications using AWS services
Teaching a Designer to Use GitHub
Hipster JS: Angular & Firebase (Tri-JS Meetup)
Deploying Web Apps with PaaS and Docker Tools
Capybara
DevOps best practices with OpenShift
Automating Aegir Platform builds with Git; Fabric; and Drush
Ruote: A Ruby workflow engine
Ad

Viewers also liked (14)

PDF
EXPO: racconta la tua identità
PDF
Pengembangan Unit Bisnis Distribusi
PDF
Analyse three real adverts
DOCX
Unidad educativa particular
PDF
Analyse 3 digipaks
PDF
Management trout on strategy
PPT
Core audio
PDF
Innovative Training Tools
PDF
Nuovi strumenti formativi
PDF
Para tikus, pasta gigi, dan problem solving
PDF
New Business Model: crearlo, analizzarlo, integrarlo, attuarlo
PDF
Kebijakan penjualan & pembelian
PDF
Ultimate startup marketing guide
PPTX
Earthquake presentation
EXPO: racconta la tua identità
Pengembangan Unit Bisnis Distribusi
Analyse three real adverts
Unidad educativa particular
Analyse 3 digipaks
Management trout on strategy
Core audio
Innovative Training Tools
Nuovi strumenti formativi
Para tikus, pasta gigi, dan problem solving
New Business Model: crearlo, analizzarlo, integrarlo, attuarlo
Kebijakan penjualan & pembelian
Ultimate startup marketing guide
Earthquake presentation
Ad

Similar to Beginning Rails Twitter Bootstrap and Zurb Foundation (20)

PDF
Twitter bootstrap on rails
PDF
Demystifying Ruby on Rails
PDF
RoR 101: Session 6
PDF
Railsgirls: Where did my HTML and CSS go
PPTX
Bootstrap rails-app
PDF
Top 8 Ruby on Rails Gems
ODP
iPhone Web Development and Ruby On Rails
KEY
Twitter bootstrap
PDF
Web Application Intro for RailsGirls Berlin May 2013
PDF
The next step is... Bootstrap by Omar Qunsul
KEY
Rapid Prototyping FTW!!!
PPTX
Ruby on Rails + AngularJS + Twitter Bootstrap
PPTX
Intro to Rails Give Camp Atlanta
PDF
One does not simply "Upgrade to Rails 3"
PDF
RoR 101: Session 2
PDF
Rails missing features
PDF
Create a new project in ROR
PPTX
Getting started with rails active storage wae
PDF
Rails入門與新人實戰經驗分享
PDF
Everything is Awesome - Cutting the Corners off the Web
Twitter bootstrap on rails
Demystifying Ruby on Rails
RoR 101: Session 6
Railsgirls: Where did my HTML and CSS go
Bootstrap rails-app
Top 8 Ruby on Rails Gems
iPhone Web Development and Ruby On Rails
Twitter bootstrap
Web Application Intro for RailsGirls Berlin May 2013
The next step is... Bootstrap by Omar Qunsul
Rapid Prototyping FTW!!!
Ruby on Rails + AngularJS + Twitter Bootstrap
Intro to Rails Give Camp Atlanta
One does not simply "Upgrade to Rails 3"
RoR 101: Session 2
Rails missing features
Create a new project in ROR
Getting started with rails active storage wae
Rails入門與新人實戰經驗分享
Everything is Awesome - Cutting the Corners off the Web

Recently uploaded (20)

PPTX
Cloud computing and distributed systems.
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Empathic Computing: Creating Shared Understanding
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Machine learning based COVID-19 study performance prediction
PDF
Encapsulation theory and applications.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Approach and Philosophy of On baking technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
Cloud computing and distributed systems.
Reach Out and Touch Someone: Haptics and Empathic Computing
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Digital-Transformation-Roadmap-for-Companies.pptx
Empathic Computing: Creating Shared Understanding
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Spectral efficient network and resource selection model in 5G networks
Unlocking AI with Model Context Protocol (MCP)
Machine learning based COVID-19 study performance prediction
Encapsulation theory and applications.pdf
Big Data Technologies - Introduction.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Chapter 3 Spatial Domain Image Processing.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Approach and Philosophy of On baking technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation

Beginning Rails Twitter Bootstrap and Zurb Foundation

  • 1. From Zero to Twitter Bootstrap & Zurb Foundation on a Rails Backend Stephen Cussen for RubyABQ Dec 11th, 2013
  • 2. the plan • ‘from scratch’, without any previous experience, build working rails app with bootstrap and foundation front ends
  • 3. what are the components? • Rails - well you all know what this is but the power of rails was a real eye-opener for me! • Twitter Bootstrap … • Zurb Foundation …
  • 4. where did I start? • the instruction from Michael (on the wiki): • 1: install homebrew • 2: install rvm • 3: install rails • 4: go for it!
  • 5. so… • I installed Rails 4.0 • new project named ‘artcards’ • built my ‘artist’model - first name, last name, description and small image name, large image name • migrated the database • ran the server - it worked! :-) (nothing much to show yet)
  • 6. branch • created a bootstrap branch from master in git • installed the bootstrap rails gem (show the Gemfile on the branch - talk about less and libv8) • ran ‘rails g bootstrap:install’
  • 7. adding images to the database • moving back to the master - needed an image strategy. Chose paperclip • added the paperclip gem • ran ‘rails g paperclip artist <image_field_name>’ for a couple of image fields • migrated the db • edited artist.rb (insert ‘has_attached_file’) • edited the _form.html.erb and the show.html.erb • And… I could select an image when I was using the form but no images in the show artist :-(
  • 8. easy to lose a few hours… - added the paperclip gem (and installed imagemagick) - rails generate paperclip artist small_image - rails generate paperclip artist large_image - rake db:migrate - edit artis.rb - edit _form.html.erb - edit show.html.erb - when adding the image - looks good - however, no image path is stored - Took a few hours and lots of reading to find out I needed to edit ‘artists_controllers.rb’ and add this params.require(:artist).permit(:firstname, :lastname, :artiststatement, :smallimagename, :largeimagename, :small_image, :large_image) (I have a pull request in for the thouhtbot rdoc that I was working from - paperclip README is good and covers this)
  • 9. more images stuff • installed imagemagick on the base rails install with paperclip and imagemagik • edited config/environments/development.rb to point to imagemagik • edited index.html.erb to include thumb and change heading • voila! (show the artists demo from master)
  • 10. images to bootstrap • merged from master to the bootstrap branch so that I could have all my good paperclip work and the bootstrap work together (my first non-gui merge prompted a call for help!) • on the bootstrap branch - set to work on making the bootstrap layout ‘bootstrappy’
  • 11. bootstrappy! • ran ‘rails g bootstrap:layout application fixed’ to generate a bootstrap compatible layout (show layouts) • voila (show the artists demo from the bootstrap branch)
  • 12. zurb foundation • created a ‘foundation’ branch • followed the super easy getting started with zurb foundation docs (note: the rails install is under ‘Applications’) • using the the ‘foundation-rails’gem did the bundle and install • made a couple of mods to add a grid layout and a navbar • and we have this (show the artists demo from the foundation branch)
  • 13. github.com/scussen • github.com/scussen/artcardbackend • ‘master’ contains the base install with paperclip the art cards project and artists application • the ‘boostrap’ branch contains the bootstrap gem and install, together with the bootstrap-ized artists application • the ‘foundation’ branch contains the foundation gem and install, together with the foundation-ized artists application
  • 14. resources • getting started with rails - http://guides.rubyonrails.org/getting_started.html • the amazing Ryan Bates - Rails Cast #328 • getting started with bootstrap - http://getbootstrap.com/getting-started/ • The bootstrap rails gem doc - https://github.com/seyhunak/twitter-bootstrap-rails • rubyracer gem (V8 Javascript interpreter for ruby ) doc - https://github.com/cowboyd/therubyracer • Paperclip - early (2008) Ryan Bates - Rails Cast #134 • paperclip doc - https://github.com/thoughtbot/paperclip • getting started with foundation - http://foundation.zurb.com/docs/ • again, Ryan Bates - Rails Cast #417 - http://railscasts.com/episodes/417-foundation • and, what would I do without stackoverflow!

Editor's Notes

  • #2: start the presentation!