Ich habe versucht, die Ladezeit der Seite in Rails 3, ich einige durch blogs ging zu verbessern, wo ich, dass ich gelernt, die CSS umfassen kann, js Dateinamen in application.css und application.js beziehungsweise.Wie mehrere css, js Dateien zu kombinieren und als eine Datei in Schienen 3 dienen?
Für Testzwecke entfernte ich die Dateien aus dem Layout und enthalten es in application.css und dann auf Seite neu laden die CSS Dateien nachladen nicht.
Meine aktuelle application.css Datei:
/*
* 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, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, 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 top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require 'owl.carousel.min.css'
*= require 'owl.carousel.min.css'
*= require 'owl.theme.min.css'
*= require "flag-sprites.min.css"
*= require 'owl.transitions.min.css'
*/
layout.html.erb:
<%= stylesheet_link_tag "application.css" %>
Was ist das Hauptproblem? – uzaif
Mithilfe des obigen Codes werden die oben genannten CSS-Dateien nicht geladen. – sahil
entferne .css und verwende nicht quot mit 'require' – uzaif