Answer the question
In order to leave comments, you need to log in
Why are bootstrap styles not loading in Rails?
For some reason, styles in the Rails application do not want to be loaded.
#gemfile
gem 'sass-rails', '~> 5.0'
gem 'bootstrap-sass'
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require_tree .
*/
@import "bootstrap-sprockets";
@import "bootstrap";
//= require jquery
//= require bootstrap-sprockets
//= require jquery_ujs
//= require turbolinks
//= require_tree .
Mongoid.load!("config/mongoid.yml", :development)
development:
clients:
default:
database: app
hosts:
- localhost:27017
options:
options:
test:
clients:
default:
database: app_test
hosts:
- localhost:27017
options:
read:
mode: :primary
max_pool_size: 1
Answer the question
In order to leave comments, you need to log in
The problem was that my controller had not class BotsController < ApplicationController, but class BotsController < ActionController::Base
According to the documentation, app/assets/stylesheets/application.scss is still possible in css format.
You need to do:
mv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question