Module: MongoJob::WebHelpers
- Defined in:
- lib/mongojob/web/helpers.rb
Instance Method Summary collapse
- #request_uri ⇒ Object
- #versioned_css(stylesheet) ⇒ Object
- #versioned_js(js) ⇒ Object
- #versioned_resource(resource) ⇒ Object
Instance Method Details
#request_uri ⇒ Object
25 26 27 |
# File 'lib/mongojob/web/helpers.rb', line 25 def request_uri request.env["REQUEST_URI"] end |
#versioned_css(stylesheet) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/mongojob/web/helpers.rb', line 2 def versioned_css(stylesheet) # Check for css and sass files css_file = File.join(MongoJob::Web.public,"style", "#{stylesheet}.css") sass_file = File.join(MongoJob::Web.views,"style", "#{stylesheet}.sass") if File.exists? css_file mtime = File.mtime(css_file).to_i.to_s else if File.exists? sass_file mtime = File.mtime(sass_file).to_i.to_s end end mime ||= '0' "/style/#{stylesheet}.css?" + mtime end |