O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Bootstrap for Rails

Book Description

A quick-start guide to developing beautiful web applications with the Bootstrap toolkit and Rails framework

In Detail

Bootstrap is a free, open source CSS and JS framework that helps you create websites in minutes, and Ruby on Rails, or Rails as it's known, is an open source web application framework written in the Ruby programming language. Bootstrap is typically used in Rails applications to design websites and create themes because it comes loaded with predesigned CSS and HTML templates.

Bootstrap for Rails is for Rails web developers who are struggling to get their website designs right. It will enable you to create beautiful responsive websites in minutes without writing much CSS and JavaScript code.

The book starts by taking you through web application development in Rails. It teaches you how to set up the Bootstrap framework, and will showcase the true power of your Rails app using Bootstrap's grid system. You will learn about other Bootstrap components and move on to work with modals and carousels. It concludes with the opportunity to test your skills by creating a shopping cart using Bootstrap modals.

What You Will Learn

  • Discover how to use Bootstrap in a Ruby on Rails environment
  • Use advanced components and plugins from Bootstrap in Rails applications
  • Create navigation bars to enable navigation between different views
  • Understand Bootstrap's grid system and create page layouts
  • Use Bootstrap's typography, buttons, and images in a Rails application
  • Design a dummy shopping cart Rails application using Bootstrap

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Bootstrap for Rails
    1. Table of Contents
    2. Bootstrap for Rails
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Introducing Web Application Development in Rails
      1. Why Bootstrap with Rails?
      2. Setting up a Todo application in Rails
      3. Analyzing folder structure of a Rails application
      4. Creating views
      5. Styling views using CSS
        1. Redesigning the Todo application
      6. Challenges in styling a Rails application traditionally
      7. Summary
    9. 2. Introducing Bootstrap 3
      1. What is Bootstrap?
      2. Installing Bootstrap in a Rails project
        1. Placing Bootstrap files in a Rails project
        2. Bootstrap – the Sass way
        3. Bootstrap through CDN
      3. Summary
    10. 3. Powering a Rails App with Bootstrap's Grid System
      1. What is Bootstrap's grid system?
      2. Nesting columns
      3. Implementing Bootstrap's grid system in a Rails application
      4. Summary
    11. 4. Using Bootstrap's Typography, Buttons, and Images in a Rails Application
      1. Setting up
      2. Styling typography
        1. Aligning text
        2. Text transformation
        3. Blockquotes
        4. Styling listing elements
      3. Creating and styling buttons
        1. Which elements are eligible to use Bootstrap's button classes?
      4. Styling images in Bootstrap
      5. Summary
    12. 5. Reinventing Tables and Forms in Bootstrap
      1. Creating Bootstrap tables
      2. Creating Bootstrap forms
      3. Validation classes in Bootstrap forms
        1. Adding Bootstrap tables to our Rails application
        2. Adding Bootstrap forms to our Rails application
      4. Summary
    13. 6. Creating Navigation Bars
      1. Getting started with a navigation bar
      2. Navigation bar helper classes
      3. Adding a navigation bar to the Rails application
      4. Summary
    14. 7. Various Other Bootstrap Components
      1. Bootstrap Breadcrumbs
      2. The pagination component
      3. Bootstrap labels and badges
      4. Bootstrap jumbotrons
      5. Alerts
      6. Creating a progress bar
      7. Panels
      8. Summary
    15. 8. Working with Bootstrap Modals
      1. Getting started with modals
      2. Changing Bootstrap's modal size
      3. Additional Bootstrap modal features
      4. Fetching remote content from a Bootstrap modal
      5. Using Bootstrap's modal in a Rails application
      6. Summary
    16. 9. Creating Image Slideshows with Bootstrap Carousel
      1. Getting started with Bootstrap Carousel
      2. Adding captions to the slides
      3. Customizing Carousel
      4. Summary
    17. 10. Creating a Shopping Cart Using Bootstrap Modals
      1. Adding a shopping cart symbol
      2. Creating a shopping cart using modals
      3. Summary
    18. A. Adding Custom Styles to a Rails Application
      1. Adding Bootstrap-sass to a Rails application
      2. Customizing Bootstrap through variables
      3. Summary
    19. Index