skip to Main Content

I am new to bootstrap and UI stuff.
Was trying implementation of grid by following this doc
https://getbootstrap.com/docs/4.1/layout/grid/

Came across this strange UI issue in my rails 5 app.
We use these gems ‘bootstrap-sass'(3.3.7) and ‘bootstrap_form’ (2.7.0)

We have included boostrap admin.html.erb.

 <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" type='text/css'>

However, in some admin pages bootstrap seems to be loading.
enter image description here

Whereas in some other admin pages, like the one below, bootstrap is just not loading.
enter image description here
Not able to figure out why.

2

Answers


  1. Chosen as BEST ANSWER

    The admin part of my project is using bootstrapv2.3.2 Though my project includes 'bootstrap-sass'(3.3.7) in the Gemfile, it is rendered only in non-admin parts of my project. The admin part renders under a different layout which uses bootstrapv2.3.2

    bootstrap2.3.2 had custom styling for class name span, however it did not support col-md-*.

    col-md-* was introduced in bootstrap 3 and used in higher versions as well.

    That is why in pages where I have used span, bootstrap styling got applied. When I tried using col-md bootstrap styling did not get applied.


  2. First, Bootstrap 2.3.2 is no longer supported so I would recommend upgrading to a later version.

    Second, you should really use one of the Bootstrap Gems, which comes with step-by-step instructions specific to Rails

    For Bootstrap 2 and 3: Bootstrap Sass

    For Bootstrap 4: Bootstrap Ruby Gem

    Because you are new to Bootstrap, I would also recommend using Bootstrap 4 (unless you have a reason not to do so).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search