SlideShare a Scribd company logo
1 of 14
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

What's hot

Capybara + RSpec - ruby dsl-based web ui qa automation
Capybara + RSpec - ruby dsl-based web ui qa automationCapybara + RSpec - ruby dsl-based web ui qa automation
Capybara + RSpec - ruby dsl-based web ui qa automationCOMAQA.BY
 
Hadoop Demystified + Automation Smackdown! Austin JUG June 24 2014
Hadoop Demystified + Automation Smackdown!  Austin JUG June 24 2014Hadoop Demystified + Automation Smackdown!  Austin JUG June 24 2014
Hadoop Demystified + Automation Smackdown! Austin JUG June 24 2014datafundamentals
 
End-to-end CI/CD deployments of containerized applications using AWS services
End-to-end CI/CD deployments of containerized applications using AWS servicesEnd-to-end CI/CD deployments of containerized applications using AWS services
End-to-end CI/CD deployments of containerized applications using AWS servicesMassimo Ferre'
 
Teaching a Designer to Use GitHub
Teaching a Designer to Use GitHubTeaching a Designer to Use GitHub
Teaching a Designer to Use GitHubLiam Dempsey
 
Hipster JS: Angular & Firebase (Tri-JS Meetup)
Hipster JS: Angular & Firebase (Tri-JS Meetup)Hipster JS: Angular & Firebase (Tri-JS Meetup)
Hipster JS: Angular & Firebase (Tri-JS Meetup)Lee Trout
 
Deploying Web Apps with PaaS and Docker Tools
Deploying Web Apps with PaaS and Docker ToolsDeploying Web Apps with PaaS and Docker Tools
Deploying Web Apps with PaaS and Docker ToolsEddie Lau
 
DevOps best practices with OpenShift
DevOps best practices with OpenShiftDevOps best practices with OpenShift
DevOps best practices with OpenShiftMichael Lehmann
 
Automating Aegir Platform builds with Git; Fabric; and Drush
Automating Aegir Platform builds with Git; Fabric; and DrushAutomating Aegir Platform builds with Git; Fabric; and Drush
Automating Aegir Platform builds with Git; Fabric; and DrushIain Houston
 
Ruote: A Ruby workflow engine
Ruote:  A Ruby workflow engineRuote:  A Ruby workflow engine
Ruote: A Ruby workflow engineWes Gamble
 

What's hot (10)

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

Viewers also liked

EXPO: racconta la tua identità
EXPO: racconta la tua identitàEXPO: racconta la tua identità
EXPO: racconta la tua identitàRisorsa Uomo
 
Pengembangan Unit Bisnis Distribusi
Pengembangan Unit Bisnis DistribusiPengembangan Unit Bisnis Distribusi
Pengembangan Unit Bisnis DistribusiToni Wijaya
 
Analyse three real adverts
Analyse three real advertsAnalyse three real adverts
Analyse three real advertsNTKhanam
 
Analyse 3 digipaks
Analyse 3 digipaksAnalyse 3 digipaks
Analyse 3 digipaksNTKhanam
 
Management trout on strategy
Management trout on strategyManagement trout on strategy
Management trout on strategyToni Wijaya
 
Core audio
Core audioCore audio
Core audioscussen
 
Innovative Training Tools
Innovative Training ToolsInnovative Training Tools
Innovative Training ToolsRisorsa Uomo
 
Nuovi strumenti formativi
Nuovi strumenti formativiNuovi strumenti formativi
Nuovi strumenti formativiRisorsa Uomo
 
Para tikus, pasta gigi, dan problem solving
Para tikus, pasta gigi, dan problem solvingPara tikus, pasta gigi, dan problem solving
Para tikus, pasta gigi, dan problem solvingToni Wijaya
 
New Business Model: crearlo, analizzarlo, integrarlo, attuarlo
New Business Model: crearlo, analizzarlo, integrarlo, attuarloNew Business Model: crearlo, analizzarlo, integrarlo, attuarlo
New Business Model: crearlo, analizzarlo, integrarlo, attuarloRisorsa Uomo
 
Kebijakan penjualan & pembelian
Kebijakan penjualan & pembelianKebijakan penjualan & pembelian
Kebijakan penjualan & pembelianToni Wijaya
 
Ultimate startup marketing guide
Ultimate startup marketing guideUltimate startup marketing guide
Ultimate startup marketing guideToni Wijaya
 
Earthquake presentation
Earthquake presentationEarthquake presentation
Earthquake presentationdrobe113
 

Viewers also liked (14)

EXPO: racconta la tua identità
EXPO: racconta la tua identitàEXPO: racconta la tua identità
EXPO: racconta la tua identità
 
Pengembangan Unit Bisnis Distribusi
Pengembangan Unit Bisnis DistribusiPengembangan Unit Bisnis Distribusi
Pengembangan Unit Bisnis Distribusi
 
Analyse three real adverts
Analyse three real advertsAnalyse three real adverts
Analyse three real adverts
 
Unidad educativa particular
Unidad educativa particularUnidad educativa particular
Unidad educativa particular
 
Analyse 3 digipaks
Analyse 3 digipaksAnalyse 3 digipaks
Analyse 3 digipaks
 
Management trout on strategy
Management trout on strategyManagement trout on strategy
Management trout on strategy
 
Core audio
Core audioCore audio
Core audio
 
Innovative Training Tools
Innovative Training ToolsInnovative Training Tools
Innovative Training Tools
 
Nuovi strumenti formativi
Nuovi strumenti formativiNuovi strumenti formativi
Nuovi strumenti formativi
 
Para tikus, pasta gigi, dan problem solving
Para tikus, pasta gigi, dan problem solvingPara tikus, pasta gigi, dan problem solving
Para tikus, pasta gigi, dan problem solving
 
New Business Model: crearlo, analizzarlo, integrarlo, attuarlo
New Business Model: crearlo, analizzarlo, integrarlo, attuarloNew Business Model: crearlo, analizzarlo, integrarlo, attuarlo
New Business Model: crearlo, analizzarlo, integrarlo, attuarlo
 
Kebijakan penjualan & pembelian
Kebijakan penjualan & pembelianKebijakan penjualan & pembelian
Kebijakan penjualan & pembelian
 
Ultimate startup marketing guide
Ultimate startup marketing guideUltimate startup marketing guide
Ultimate startup marketing guide
 
Earthquake presentation
Earthquake presentationEarthquake presentation
Earthquake presentation
 

Similar to Beginning Rails Twitter Bootstrap and Zurb Foundation

Drupal Step-by-Step: How We Built Our Training Site, Part 2
Drupal Step-by-Step: How We Built Our Training Site, Part 2Drupal Step-by-Step: How We Built Our Training Site, Part 2
Drupal Step-by-Step: How We Built Our Training Site, Part 2Acquia
 
Rails 5 subjective overview
Rails 5 subjective overviewRails 5 subjective overview
Rails 5 subjective overviewJan Berdajs
 
SharePoint Framework, Angular and Azure Functions
SharePoint Framework, Angular and Azure FunctionsSharePoint Framework, Angular and Azure Functions
SharePoint Framework, Angular and Azure FunctionsSébastien Levert
 
The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)
The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)
The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)Ranel Padon
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Derek Jacoby
 
Riding the Edge with Ember.js
Riding the Edge with Ember.jsRiding the Edge with Ember.js
Riding the Edge with Ember.jsaortbals
 
Vue 淺談前端建置工具
Vue 淺談前端建置工具Vue 淺談前端建置工具
Vue 淺談前端建置工具andyyou
 
Chaione Ember.js Training
Chaione Ember.js TrainingChaione Ember.js Training
Chaione Ember.js Trainingaortbals
 
Contributing to rails
Contributing to railsContributing to rails
Contributing to railsLukas Eppler
 
Treeshaking your CSS
Treeshaking your CSSTreeshaking your CSS
Treeshaking your CSSJames Stone
 
DockerCon SF 2015: Maintaining the Official Node.js Docker Image
DockerCon SF 2015: Maintaining the Official Node.js Docker ImageDockerCon SF 2015: Maintaining the Official Node.js Docker Image
DockerCon SF 2015: Maintaining the Official Node.js Docker ImageDocker, Inc.
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Developmentmwrather
 
SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...
SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...
SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...Sébastien Levert
 
Untangling spring week5
Untangling spring week5Untangling spring week5
Untangling spring week5Derek Jacoby
 
Introduction to Drupal 7 - Making a slideshow with Views 3
Introduction to Drupal 7 - Making a slideshow with Views 3Introduction to Drupal 7 - Making a slideshow with Views 3
Introduction to Drupal 7 - Making a slideshow with Views 3Kalin Chernev
 
RoR (Ruby on Rails)
RoR (Ruby on Rails)RoR (Ruby on Rails)
RoR (Ruby on Rails)scandiweb
 
DockerCon SF 2015: Maintaining the official node.js docker image
DockerCon SF 2015: Maintaining the official node.js docker imageDockerCon SF 2015: Maintaining the official node.js docker image
DockerCon SF 2015: Maintaining the official node.js docker imageDocker, Inc.
 

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

Drupal Step-by-Step: How We Built Our Training Site, Part 2
Drupal Step-by-Step: How We Built Our Training Site, Part 2Drupal Step-by-Step: How We Built Our Training Site, Part 2
Drupal Step-by-Step: How We Built Our Training Site, Part 2
 
Rails 5 subjective overview
Rails 5 subjective overviewRails 5 subjective overview
Rails 5 subjective overview
 
SharePoint Framework, Angular and Azure Functions
SharePoint Framework, Angular and Azure FunctionsSharePoint Framework, Angular and Azure Functions
SharePoint Framework, Angular and Azure Functions
 
The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)
The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)
The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
 
Riding the Edge with Ember.js
Riding the Edge with Ember.jsRiding the Edge with Ember.js
Riding the Edge with Ember.js
 
Vue 淺談前端建置工具
Vue 淺談前端建置工具Vue 淺談前端建置工具
Vue 淺談前端建置工具
 
Chaione Ember.js Training
Chaione Ember.js TrainingChaione Ember.js Training
Chaione Ember.js Training
 
Contributing to rails
Contributing to railsContributing to rails
Contributing to rails
 
Top 8 Ruby on Rails Gems
Top 8 Ruby on Rails GemsTop 8 Ruby on Rails Gems
Top 8 Ruby on Rails Gems
 
Treeshaking your CSS
Treeshaking your CSSTreeshaking your CSS
Treeshaking your CSS
 
DockerCon SF 2015: Maintaining the Official Node.js Docker Image
DockerCon SF 2015: Maintaining the Official Node.js Docker ImageDockerCon SF 2015: Maintaining the Official Node.js Docker Image
DockerCon SF 2015: Maintaining the Official Node.js Docker Image
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Development
 
SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...
SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...
SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...
 
Untangling spring week5
Untangling spring week5Untangling spring week5
Untangling spring week5
 
Supa fast Ruby + Rails
Supa fast Ruby + RailsSupa fast Ruby + Rails
Supa fast Ruby + Rails
 
Rails 3.1
Rails 3.1Rails 3.1
Rails 3.1
 
Introduction to Drupal 7 - Making a slideshow with Views 3
Introduction to Drupal 7 - Making a slideshow with Views 3Introduction to Drupal 7 - Making a slideshow with Views 3
Introduction to Drupal 7 - Making a slideshow with Views 3
 
RoR (Ruby on Rails)
RoR (Ruby on Rails)RoR (Ruby on Rails)
RoR (Ruby on Rails)
 
DockerCon SF 2015: Maintaining the official node.js docker image
DockerCon SF 2015: Maintaining the official node.js docker imageDockerCon SF 2015: Maintaining the official node.js docker image
DockerCon SF 2015: Maintaining the official node.js docker image
 

Recently uploaded

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Recently uploaded (20)

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

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

  1. start the presentation!