Module: Paste::Rails::Helper
- Defined in:
- lib/paste/rails/helper.rb
Instance Method Summary collapse
- #include_javascripts(*javascripts) ⇒ Object (also: #include_javascript, #javascript, #javascripts)
- #include_stylesheets(*css) ⇒ Object (also: #stylesheet, #stylesheets, #include_stylesheet)
- #included_javascripts ⇒ Object
- #included_stylesheets ⇒ Object
- #javascript_tags(*javascripts) ⇒ Object
- #stylesheet_tags(*other_css) ⇒ Object
Instance Method Details
#include_javascripts(*javascripts) ⇒ Object Also known as: include_javascript, javascript, javascripts
24 25 26 27 28 |
# File 'lib/paste/rails/helper.rb', line 24 def include_javascripts *javascripts @javascripts ||= [] @javascripts += javascripts.flatten @javascripts.uniq! end |
#include_stylesheets(*css) ⇒ Object Also known as: stylesheet, stylesheets, include_stylesheet
34 35 36 37 38 |
# File 'lib/paste/rails/helper.rb', line 34 def include_stylesheets *css @css ||= [] @css += css.flatten @css.uniq! end |
#included_javascripts ⇒ Object
30 31 32 |
# File 'lib/paste/rails/helper.rb', line 30 def included_javascripts @javascripts end |
#included_stylesheets ⇒ Object
40 41 42 |
# File 'lib/paste/rails/helper.rb', line 40 def included_stylesheets @css end |
#javascript_tags(*javascripts) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/paste/rails/helper.rb', line 7 def *javascripts include_javascripts *javascripts results = Paste::Rails.glue.paste *@javascripts javascript_include_tag *add_cache_argument(results[:javascripts]) end |
#stylesheet_tags(*other_css) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/paste/rails/helper.rb', line 15 def *other_css include_stylesheets *other_css results = Paste::Rails.glue.paste *(@javascripts ||= []) all_css = (results[:stylesheets] + @css).uniq stylesheet_link_tag *add_cache_argument(all_css) end |