I am using Ruby 2.4.1 / Rails 5.1.6
I have dropdown menus in my Bootstrap navigation bar. I finally got them to work in my development environment, but they do not work when pushed to Heroku. Here is my application.js file:
//
//= require jquery
//= require jquery_ujs
//= require bootstrap-sprockets
//= require turbolinks
//= require_tree .
I have read from other Stackoverflow posts that some folks have luck when they reorder this list. However, doing so breaks things in development, which is no good.
Here is my Gemfile:
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
gem 'bootstrap-sass', '~> 3.3.7'
gem 'jquery-rails'
gem 'rails', '~> 5.1.4'
gem 'puma', '~> 3.7'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'bcrypt', '~> 3.1.7'
group :development, :test do
gem 'sqlite3'
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'capybara', '~> 2.13'
gem 'selenium-webdriver'
end
group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :production do
gem 'pg', '~> 0.18'
gem 'rails_12factor'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
application.scss:
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
* vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
*= require_tree .
*= require_self
*/
@import "bootstrap-sprockets"; // suggested change from SO user.
@import "bootstrap"; // suggested change from SO user.
custom.css.scss:
@import "bootstrap-sprockets";
@import "bootstrap";
.listing {
list-style: none;
padding-left: 0;
}
.username-link {
padding-top: 10px;
}
I also read answers where precompiling assets fixed the issue, however, this did not fix it for me (it might've been one of the things that helped getting it working in my development environment though).
I've tried clearing my cookies and history as a dramatic step, and no joy.
I've tried adding @imports to application.scss directly instead of in custom.css.scss.
I've removed //= require rails_ujs, since it is redundant with //= require jquery_ujs
Any suggestions appreciated.