Bootstrap Quickstart on RailsResources

First, what is even Bootstrap? Bootstrap is an open-source front-end framework that has many pre-built html and css templates/classes. This framework was originally developed by Twitter as “Twitter Blueprint” and eventually released to the public as an open source project on August 19, 2011. Some benefits for using Bootstrap over regular css/html is that it is browser compatible, faster development, responsive layout, and a good fit for people with little front-end experience or design/UI sensibility.

Installation

To start using Bootstrap via a Rails app, first add Bootstrap to your Gemfile. I opted for a Sass variant so mine would look like the following:gem 'bootstrap-sass' . Thereafter, in your Rails generated assets directory and under its stylesheet folder, there should be an application.css file. Make sure to add the following line of code to this file:

@import “bootstrap”;

If you are following along with me and also decided to use the sass variant, make sure to rename this stylesheet and add the extension “.scss” so the file name would ultimately be application.css.scss. Voila, it’s as easy as that, you should now be setup to make all kinds of beautiful web pages. Another way to install Bootstrap that is not rails specific is to embed the Bootstrap CDN within the header of each html page (or the single layout page) like so:


    TomsRailsPractice
    
    

    
    
    
    
    
    

Let’s Cheat Kind-Of

Now that we have Bootstrap setup, we can jump right into making our webpages look beautiful. However, I’m not about to just head into how to make a pretty button, or how to properly align forms, or talk about any one of millions of Bootstrap customization tricks. I’m going to admit that I have no idea what I am doing and, with a project due in a week, going to let other people do the brunt of the work. How? Through Bootstrap templates.

There are many sites that offer free Bootstrap templates that can make your app go from an ugly, white, blue links, everything in the left, piece of crap to a decent looking web page (and some of them are actually really quite beautiful). I will list some of these sites in the resource section. Most of these templates will come with an option to download them onto your local machine and store the html with Bootstrap classes, custom css stylesheets, and images. However, there’s no need for I will tell you how to do this purely from online.

You can do this straight from the inspect or view source code page, where you can copy and paste over the desired elements of the page into your apps own view files. The Bootstrap html classes should do a lot of the legwork but to completely imitate the aesthetic, you will have to carry over the references to custom stylesheet and fonts within the . Here’s the tricky part: those paths should be relative only within the context of where that page is being run/displayed. Therefore, you will most likely have to prepend the url where you are displaying that page on in the browser. That’s that! You will now be able to display your app with whatever Bootstrap template. However, I recommend that you download the templates and have the stylesheets and other references locally, incase the site these are from goes offline for whatever reason. Plus, they’ll usually come with super helpful instructions and readme!

Now, this is probably the most important part of this blog. I believe you can do this with whatever page being displayed on the web (via view source and what not). However, I’m pretty sure this can be considered as plagiarizing and copywriting, so make sure to do this with permissible, approved, and template examples.

Conclusion

All in all, this was a guide to get you started on a Bootstrap project the quickest way possible. If you are like me, coming from a backend heavy track and need to create a web app using Rails, take advantage of Bootstrap and templates. However, I still would highly recommend spending time spinning up your own creative and beautiful designs. What’s the point of using someone else’s design and template, where’s the fun in that. I would even go as far as to suggest try spinning up designs with pure css (not the Pure framework), which let’s you really have that freedom and stretch your creative juice (don’t become a “Bootstrap Designer” jk). Definitely, do though, look at these templates for inspiration and ways to implement your very own idea.

Further reading:

Angular 8 Tutorial Facebook Login with Example
https://morioh.com/p/a83878b5f50a

HTML 5 Tutorial: How to create a table using HTML tags and Stylesheet (CSS)
https://morioh.com/p/5882025685ae

The Complete 2019 Web Development Bootcamp
http://class.learnstartup.net/p/2AZb3GVTl

Basic to Semantic HTML: How to Structure Web Pages
http://class.learnstartup.net/p/rkF4wUftW

Web Development for beginners: Build Website from Scratch
http://class.learnstartup.net/p/Hke2UpV5W

#web-development #ruby-on-rails #ruby #bootstrap

Bootstrap Quickstart on RailsResources
11.45 GEEK