【发布时间】:2020-10-26 18:01:06
【问题描述】:
我尝试了很多东西,但我的导航栏没有在浏览器上正确显示,只是因为 sccs 没有加载。这个应用程序是一个 Rails API 应用程序,我转换为常规应用程序。可能这个过程出了点问题。
Assets/Stylesheets/application.scss
// Your CSS partials
@import "components/index";
Assets/Stylesheets/Components/_index.scss
// Import your components CSS files here.
@import "navbar";
Assets/Stylesheets/Components/_navbar.scss
Environments/development.rb
config.assets.debug = true
config.assets.quiet = true
config.assets.compile = true
application.rb
require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module RailsJwt
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.0
# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
# -- all .rb files in that directory are automatically loaded after loading
# the framework and any gems in your application.
end
end
我是新来的,所以我不知道应该显示我的应用程序的哪些其他部分。
【问题讨论】:
-
欢迎来到 SO!您可以发布您的
application.scss文件中的其他任何内容吗?你知道你使用的是 Sprockets 还是 Webpacker?你能发布哪个版本的 Rails 吗?
标签: css ruby-on-rails