Derzeit ist mein Ereignis CSS in app/assets/stylesheets/pages/events.scss
und im Entwicklungsmodus sieht es gut aus und die Assets geladen werden. Aber bei der Produktion sieht es so aus, als wären diese Seiten überhaupt nicht geladen. Ich bin mir nicht sicher, wie ich dieses Problem beheben kann. Ich habe Rails 4: assets not loading in production betrachtet, aber ich bin nicht vertraut mit der config.assets.precompile += %w(*.js ^[^_]*.css *.css.erb)
, da es scheint, dass der Pfad selbst nicht in der Produktion funktioniert.Rails Assets sind in einem Unterverzeichnis und können nicht in Produktion geladen werden
app/assets/Stylesheets/application.scss:
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
*#= require bootstrap-wysihtml5
*#= require rails_bootstrap_forms
*#= require jquery.jcrop
*= require custom
*= require_self
*/
@import "bootstrap-sprockets";
@import "bootstrap";
@import "scaffolds";
app/views/events/index.html.erb:
<% content_for :head do %>
<%= stylesheet_link_tag "pages/events", :media => "all" %>
<% end %>
app/assets/Sheets/pages/Veranstaltungen. scss
@import "globals/helpers";
@import "vendors/animate";
.events-bar {
/* a[class*="btn"] {
height: 36px;
display: inline-block;
}*/
#toggleBar {
margin-top: 14px;
}
.btn-dashboard {
background-color: #fdf9ff;
color: $eventsColour !important;
&:hover {
background-color: $eventsColour-dark !important;
}
}
}
Es war schwer zu debuggen, da es in der Entwicklung gut funktioniert und nicht in der Produktion. Es sieht so aus, als ob alle Dateien im Unterverzeichnis (app/assets/stylesheet/pages/*. Scss) in der Produktion nicht funktionieren. Jeder Einblick wird helfen, danke.
könnten Sie Ihre Gemfile teilen? – oreoluwa