Module: EtagFor
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/etag_for/railtie.rb,
lib/etag_for/version.rb,
lib/etag_for/etag_for.rb
Defined Under Namespace
Classes: Railtie
Constant Summary collapse
- VERSION =
"0.1.2"
Instance Method Summary collapse
Instance Method Details
#etag_for(item_or_items, options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/etag_for/etag_for.rb', line 4 def etag_for(item_or_items, = {}) css_file = [:css] || 'application' js_file = [:js] || 'application' files = [] files << "layouts/#{[:layout]}" if [:layout] files << [:view] if [:view] files += [:files] if [:files] [ item_or_items ].flatten + [ css_path(css_file), js_path(js_file) ] + digests_of(files) end |