Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 80 lines (53 sloc) 1.527 kb
ce0b3c3 @ddollar build out web-framework interfaces
authored
1 # AssetResource
2
3 Serve up your CSS and Javascript as first-class resources.
4
5 Supports in-line rendering of engines such as Sass and Less. These files will
6 be served with 24-hour HTTP cache expiry.
7
8 Built-in configuration and helpers for Rails 2.x, Rails 3.x and Sinatra.
9
10 ## Usage
11
12 ### Rails 2.x
13
14 # public/stylesheets/*.{css|less|sass}
15 # public/javascripts/*.js
16
17 # config/environment.rb
18 config.gem "asset-resource"
19
20 # app/views/layouts/application.html.erb
21 <html>
22 <head>
23 <%= asset_resource_stylesheets %>
24 <%= asset_resource_scripts %>
25 </head>
26 </html>
27
28 ### Rails 3.x
29
30 # public/stylesheets/*.{css|less|sass}
31 # public/javascripts/*.js
32
33 # Gemfile
34 gem "asset_resource"
35
36 # app/views/layouts/application.html.erb
37 <html>
38 <head>
39 <%= asset_resource_stylesheets %>
40 <%= asset_resource_scripts %>
41 </head>
42 </html>
43
44 ### Sinatra
45
46 # assets/styles/*.{css|less|sass}
47 # assets/scripts/*.js
48
49 # app.rb
50 require "asset_resource"
51
52 class App < Sinatra::Base
53 register Sinatra::AssetResource
54 end
55
56 __END__
57
58 @@ layout
59 %html
60 %head
61 = asset_resource_scripts
62 = asset_resource_styles
63
64 ## Technical Details
65
66 `AssetResource::Middleware` serves requests at `/assets/stylesheets.css` and
67 `/assets/javascripts.js`.
68
69 The gem will add appropriate view helpers to your framework of choice.
70
71 ## Copyright
72
73 MIT License
74
75 ## Author
76
77 David Dollar
78
79 [http://daviddollar.org](http://daviddollar.org)
Something went wrong with that request. Please try again.