Book Image

Bootstrap for Rails

By : Syed F Rahman
Book Image

Bootstrap for Rails

By: Syed F Rahman

Overview of this book

Table of Contents (18 chapters)
Bootstrap for Rails
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

Howdy! So, you want to learn Bootstrap and its awesomeness and implement it in a Rails project? I think you made the right choice by selecting this book.

Web designing is not everyone's cup of tea. I have seen many experienced web developers who are extremely poor at web designing. They have the ability to make the most powerful applications, but lack the skills to create a decent looking website.

On the other hand, there's a sudden rise in the popularity of CSS and JavaScript frontend frameworks. These frameworks let the users create popular CSS and JavaScript components, such as drop-down menus, responsive menus, a proper grid system to structure websites, and so on easily without having any knowledge about CSS and JavaScript coding. Bootstrap, being one of the pioneers in the book, provides many prestyled CSS components that come ready to be used. You simply need to know the appropriate HTML files to use these frontend frameworks.

This book will help you understand what Bootstrap is, and how it can be used in a Rails environment. It will guide you through various CSS and JavaScript components of Bootstrap via many practical examples. If you are a Sass developer, this book will help you identify various Sass variables to customize Bootstrap.

I hope you have fun reading this book!

What this book covers

Chapter 1, Introducing Web Application Development in Rails, focuses on how to beautify Rails applications through the help of Bootstrap. This explanation is followed by the summary of this chapter.

Chapter 2, Introducing Bootstrap 3, will show you how to download and use Bootstrap in Rails projects.

Chapter 3, Powering a Rails App with Bootstrap's Grid System, will take you through Bootstrap's grid system and then proceed to show you how to use it in our first example application.

Chapter 4, Using Bootstrap's Typography, Buttons and Images in a Rails Application, focuses more on how to style a website's content such as text, links, and images.

Chapter 5, Reinventing Tables and Forms in Bootstrap, will take a look at the various features of Bootstrap tables and forms. In this chapter, we will first create dummy products and then integrate them in our real application.

Chapter 6, Creating Navigation Bars, will teach you how to create a Bootstrap navigation bar, and how we can modify it to fit our needs.

Chapter 7, Various Other Bootstrap Components, will explore some more Bootstrap components, which come ready to use.

Chapter 8, Working with Bootstrap Modals, will teach you how to create a Bootstrap modal and its various types and functionalities. We will also integrate a modal component in our Rails application.

Chapter 9, Creating Image Slideshows with Bootstrap Carousel, will get you started with the Bootstrap Carousel, how to add captions to the slides, and how to customize the Carousel.

Chapter 10, Creating a Shopping Cart Using Bootstrap Modals, is all about implementing what we have learned so far in Bootstrap. This chapter will definitely clear some of the core concepts of Bootstrap such as how to use Bootstrap modal, typography, buttons, and responsive tables.

Appendix, Adding Custom Styles to a Rails Application, talks about how to add a custom style to a Rails application, which is powered by a Bootstrap framework.

What you need for this book

You need the following to work with the examples in this book:

  • Bootstrap version 3.3.1

  • Rails version 4.2

Who this book is for

This book is for web developers who have a basic understanding of Ruby on Rails. You should definitely have prior knowledge of HTML and how it works. However, it is not necessary that you have prior knowledge of CSS and JavaScript for this book.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Let's create a folder named Bootstrap_Rails_Project."

A block of code is set as follows:

a{
display: block;
text-decoration: none;
width: 100px;
margin: 10px auto;
padding: 5px;
text-align: center;
background: #ccc;
color: #444;
font-size: 20px;
box-shadow: 4px 4px 0px #888;
font-weight: bold;
}

Any command-line input or output is written as follows:

rails new TODO

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Click on the New Todo now."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

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.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.