javascript - How to combine multiple css, js files and serve as one file in rails 3? -
i have been trying improve page load time in rails 3, went through few blogs learned can include css, js file names in application.css , application.js respectively.
for testing purpose removed files layout , included in application.css, , on page reload css files didn't reload.
my current application.css file:
/* * manifest file that'll compiled application.css, include files * listed below. * * css , scss file within directory, lib/assets/stylesheets, vendor/assets/stylesheets, * or vendor/assets/stylesheets of plugins, if any, can referenced here using relative path. * * you're free add application-wide styles file , they'll appear @ top of * compiled file, it's better create 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" %>
if use
*= require_tree .
it load css files inside app/assets/stylesheet didn't need mention each file name.
one more thing note need restart server after updating application.css , application.js files. hope help.
Comments
Post a Comment