Module: Paste::Rails::Helper

Defined in:
lib/paste/rails/helper.rb

Instance Method Summary collapse

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_javascriptsObject



30
31
32
# File 'lib/paste/rails/helper.rb', line 30

def included_javascripts
  @javascripts
end

#included_stylesheetsObject



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 javascript_tags *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 stylesheet_tags *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