Skip to content

Instantly share code, notes, and snippets.

@iamatypeofwalrus
Last active February 9, 2022 15:27
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save iamatypeofwalrus/6400118 to your computer and use it in GitHub Desktop.
Save iamatypeofwalrus/6400118 to your computer and use it in GitHub Desktop.
Add Bootstrap to your Rails app without a Gem

Bootstrap 3.0 in Rails without a Gem

What is Bootstrap?

It's a collection of CSS styles and Javascript add-ons that stop your site from looking like a shitty craigslist rip off from 1996. Seriously, who wants that?

Docs: CSS, Components, Javascript

Why Install It This Way?

Finding the right gem, keeping it updated, and learning the syntax is a pain in the ass. Why not install Bootstrap the way you'd install new javascript libraries?

Instructions

  1. Cut a hole in that box...ahem. Download Bootstap 3.0 here
  2. Copy everthing in Bootstrap/dist/css/min to RAILS_APP_DIR/vendor/assests/stylesheets
  3. Copy everthing in Bootstrap/dist/js/min to RAILS_APP_DIR/vendor/assests/javascripts
  4. Add *= require bootstrap-theme.min.css to application.css
  5. Add *= require bootstrap.min.css to application.css
  6. Add //= require bootstrap.min.js to application.js
  7. ....
  8. PROFIT

Use

Go over the docs to see how you can pretty-fy the divs / headers you're already using. There will be some changes that will happen instantly. Happy de-uglify-ing :-]

@enriquesalceda
Copy link

Hi,

I customised a bootstrap for my app, I'm following these steps to added to my app. Do you have any extra recommendation?

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment