V
V
V2016-08-10 16:43:23
Ruby on Rails
V, 2016-08-10 16:43:23

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'

#application.scss
/*
 * 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";

#application.js
//= require jquery
//= require bootstrap-sprockets
//= require jquery_ujs
//= require turbolinks
//= require_tree .

#development.rb
Mongoid.load!("config/mongoid.yml", :development)
#mongoid.yml
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

2 answer(s)
V
V, 2016-08-15
@ermolushka

The problem was that my controller had not class BotsController < ApplicationController, but class BotsController < ActionController::Base

D
Denis Ilyasov, 2016-08-12
@ilyasovd

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 question

Ask a Question

731 491 924 answers to any question