Skip to content

Instantly share code, notes, and snippets.

@jarmo
Last active December 15, 2015 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jarmo/5181489 to your computer and use it in GitHub Desktop.
Save jarmo/5181489 to your computer and use it in GitHub Desktop.
# application.html.erb
<%= stylesheet_link_tag "vendor", :media => "all" %>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "vendor" %>
<%= javascript_include_tag "application" %>
# application.html.erb
<%= stylesheet_link_tag "vendor", :media => "all", :debug => false %>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "vendor", :debug => false %>
<%= javascript_include_tag "application" %>
# config/environments/production.rb
SlowAssets::Application.configure do
config.assets.precompile += %w( vendor.js vendor.css )
# ...
end
rails g controller slow index
create app/controllers/slow_controller.rb
route get "slow/index"
...
C:\Projects\Ruby>rails new slow-assets
create
create README.rdoc
create Rakefile
...
cd slow-assets
rails s
=> Booting WEBrick
=> Rails 3.2.11 application starting in development on http://0.0.0.0:3000
# Gemfile
gem 'bootstrap-sass'
gem 'jquery-ui-rails'
# application.js
//= require jquery.ui.all
//= require bootstrap
# application.css
@import "bootstrap";
@import "bootstrap-responsive";
# bundle install and restart the server
# application.js
//= require_tree .
# vendor/assets/javascripts/vendor.js
//= require jquery
//= require jquery_ujs
//= require jquery.ui.all
//= require bootstrap
# application.css
/*
*= require_self
*= require_tree .
*/
# vendor/assets/stylesheets/vendor.css
@import "bootstrap";
@import "bootstrap-responsive";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment