ruby on rails 为什么在 View 中加载 css 时布局没有改变? 目前代码如下
I will attach a screen shot of the display
confirm_csv.html.erb
<%= stylesheet_link_tag "confirm_csv", :media => "all" %>
・・・etc
配置/初始化程序/assets.rb
Rails.application.config.assets.precompile += %w( confirm_csv.css )
app/assets/stylesheets/application.css
/*
*= require_tree .
*= require_self
*/
app/assets/stylesheets/confirm_csv.css
table {
align: center;
}
最佳答案
如果您使用的是 Rails 5,请将 application.css 重命名为 application.scss,将 confirm_csv.css 重命名为 confirm_csv.css.scss。还要在 application.scss @import "confirm_csv.css"
中添加这一行。
关于html - ruby on rails 为什么在 View 中加载 css 时布局没有改变?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54209918/