Bootstrap Dropdown menu is not working

后端 未结 18 688
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 23:18

I am having trouble getting my dropdowns to work. I can get the navbar to show up perfectly, but when I click on \"Dropdown\" (either of them) it does not display the dropdo

18条回答
  •  长情又很酷
    2020-11-30 23:43

    Looks like there is more to be done for Rails 4.

    1. Inside you Gemfile add.

      gem 'bootstrap-sass', '~> 3.2.0.2'

    as seen here

    1. Next you need to run

      $bundle install

    This is the part no one has mentioned

    Open you config/application.rb file

    1. add this right before the second to last end

      config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif)

    as seen here about a 20% down the page.

    1. Next create a custom.css.scss file in this directory

      app/assets/stylesheets

    as seen here a little further down from the above task

    1. Inside that file include

      @import "bootstrap";


    Now stop your server and restart and everything should work fine.

    I tried to run bootstrap without using a gem but it didn't work for me.

    Hope that helps someone out!

提交回复
热议问题