Module: Paste::Rails::Helper
- Defined in:
- lib/paste/rails/helper.rb
Instance Method Summary collapse
- #include_css(*css) ⇒ Object (also: #css)
- #include_javascripts(*javascripts) ⇒ Object (also: #include_javascript, #javascript)
- #included_css ⇒ Object
- #included_javascripts ⇒ Object
- #paste_css_tags(*other_css) ⇒ Object
- #paste_js_tags(*javascripts) ⇒ Object
Instance Method Details
#include_css(*css) ⇒ Object Also known as: css
37 38 39 40 41 |
# File 'lib/paste/rails/helper.rb', line 37 def include_css *css @css ||= [] @css += css.flatten @css.uniq! end |
#include_javascripts(*javascripts) ⇒ Object Also known as: include_javascript, javascript
27 28 29 30 31 |
# File 'lib/paste/rails/helper.rb', line 27 def include_javascripts *javascripts @javascripts ||= [] @javascripts += javascripts.flatten @javascripts.uniq! end |
#included_css ⇒ Object
43 44 45 |
# File 'lib/paste/rails/helper.rb', line 43 def included_css @css end |
#included_javascripts ⇒ Object
33 34 35 |
# File 'lib/paste/rails/helper.rb', line 33 def included_javascripts @javascripts end |
#paste_css_tags(*other_css) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/paste/rails/helper.rb', line 16 def *other_css include_css *other_css results = Paste::Rails.glue.paste *(@javascripts ||= []) all_css = (results[:css] + @css).uniq cache = Digest::SHA1.hexdigest(all_css.sort.join)[0..12] all_css << {:cache => cache} stylesheet_link_tag *all_css end |