0

我现在完全陷入了一个非常奇怪的问题:

导航栏组件的显示方式

我尝试多次将引导程序添加到我的 RoR 项目中,如下所述:

这两种方法都不起作用,这对我来说毫无意义,显然 .css .js 文件在那里,因为您可以看到应用了一些样式但不是应该的样式。我还认为我的浏览器(chrome)把事情搞砸了,但它看起来和 safari 一样。我还尝试了不同版本的导轨,但它们也不起作用。

真的很奇怪:我在选择基础而不是引导程序时也遇到了类似的问题

我会非常感谢任何能帮助我解决这个问题的东西!

布局/application.html.erb:

<!DOCTYPE html>
<html>
  <head>
    <title>Alphablog</title>
    <%= csrf_meta_tags %>
    <%= csp_meta_tag %>

    <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track': 'reload' %>
    <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
  </head>

  <body>
    <%= yield %>
  </body>
</html>

应用程序.js:

// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
// vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file. JavaScript code in this file should be added after the last require_* statement.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery.min
//= require bootstrap.min
//= require rails-ujs
//= require activestorage
//= require turbolinks
//= require_tree .

应用程序.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 bootstrap.min
 *= require_tree .
 *= require_self
 */
4

0 回答 0