How to integrate a Wrap Bootstrap theme into an Rails application?

前端 未结 2 1803
不思量自难忘°
不思量自难忘° 2020-12-02 06:22

I have bought a twitter bootstrap theme from wrapbootstrap. I already have a functional rails application. Now, I want to design my application by integrating the bootstrap

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-02 07:21

    make sure that while installing twitter bootstrap you should add following gem into your Gemfile under "group :assets"

    gem 'therubyracer'
    gem 'less-rails'
    gem 'twitter-bootstrap-rails'
    

    then run bundle command.

    Now, the theme "file_name.css" (file_name could be any) that u have downloaded just add it into "stylesheets" folder under app->assests->stylesheets

    then open your application.css file in same folder there you will see

    *= require_tree.
    

    replace this line with

    *= require "file_name.css"
    

    NOTE: Don't forget to re-compile your assets or simply delete the content of your tmp/cache folder.

    save it and reboot your server. it will apply your new theme.

提交回复
热议问题