Rails uses bootstrap

Source: Internet
Author: User
Tags i18n time zone names

Add ' Bootstrap-sass ' to the Gemfile file and run the bundle install

' Bootstrap-sass '

Add a line of code to the CONFIG/APPLICATION.RB to make Bootstrap-sass and asset pipeline compatible

  classApplication <rails::application#Settings in config/environments/* take precedence over those specified here.    #application configuration should go to files in Config/initializers    #--All. rb files in that directory is automatically loaded.    #Set time.zone default to the specified zone and make Active Record Auto-convert to this zone.    #Run "rake-d time" for a list of the tasks for finding time zone names. Default is UTC.    #Config.time_zone = ' Central Time ' (US & Canada) '    #The default locale is:en and all translations from CONFIG/LOCALES/*.RB,YML is auto loaded.    #Config.i18n.load_path + = Dir[rails.root.join (' My ', ' locales ', ' *.{ RB,YML} '). to_s]    #Config.i18n.default_locale =:d e    #Do not swallow errors in after_commit/after_rollback callbacks.Config.active_record.raise_in_transactional_callbacks =true#make Bootstrap-sass and asset pipeline compatible   Config.assets.precompile + =%w (*.png *.jpg *.jpeg * . gif) end

To use bootstrap you also need to create a CSS file in the App/assets/stylesheets directory: custom.css.scss

The contents are:

@import "Bootstrap-sprockets" @import "Bootstrap"

Also add a line to the App/assets/javascripts/application.js file

= Require bootstrap

This enables the use of bootstrap JavaScript components.

Now it's time to start using bootstrap.

Rails uses bootstrap

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.