Module: ThemesForRails::DigestedActionView

Extended by:
ActiveSupport::Concern
Defined in:
lib/themes_for_rails/digested_action_view.rb

Instance Method Summary collapse

Instance Method Details

#current_theme_image_path(asset) ⇒ Object



20
21
22
23
# File 'lib/themes_for_rails/digested_action_view.rb', line 20

def current_theme_image_path(asset)
  image, extension = name_ext(asset)
  digest_for_image("#{image}.#{extension}", self.theme_name)
end

#current_theme_javascript_path(asset) ⇒ Object



16
17
18
# File 'lib/themes_for_rails/digested_action_view.rb', line 16

def current_theme_javascript_path(asset)
  digest_for_javascript("#{asset}.js", self.theme_name)
end

#current_theme_stylesheet_path(asset) ⇒ Object



12
13
14
# File 'lib/themes_for_rails/digested_action_view.rb', line 12

def current_theme_stylesheet_path(asset)
  digest_for_stylesheet("#{asset}.css", self.theme_name)
end

#theme_image_path(asset, new_theme_name = self.theme_name) ⇒ Object



33
34
35
# File 'lib/themes_for_rails/digested_action_view.rb', line 33

def theme_image_path(asset, new_theme_name = self.theme_name)
  path_to_image(digest_for_image(asset, new_theme_name))
end

#theme_image_submit_tag(source, options = {}) ⇒ Object



41
42
43
44
# File 'lib/themes_for_rails/digested_action_view.rb', line 41

def theme_image_submit_tag(source, options = {})
  image, extension = name_ext(source)
  image_submit_tag(theme_image_path("#{image}.#{extension}", self.theme_name), options)
end

#theme_image_tag(source, options = {}) ⇒ Object



37
38
39
# File 'lib/themes_for_rails/digested_action_view.rb', line 37

def theme_image_tag(source, options = {})
  image_tag(theme_image_path("#{source}", self.theme_name), options)
end

#theme_javascript_include_tag(*files) ⇒ Object



46
47
48
49
50
51
52
53
# File 'lib/themes_for_rails/digested_action_view.rb', line 46

def theme_javascript_include_tag(*files)
  options = files.extract_options!
  options.merge!({ :type => "text/javascript" })
  files_with_options = files.collect {|file| theme_javascript_path(file) }
  files_with_options += [options]

  javascript_include_tag(*files_with_options)
end

#theme_javascript_path(asset, new_theme_name = self.theme_name) ⇒ Object



29
30
31
# File 'lib/themes_for_rails/digested_action_view.rb', line 29

def theme_javascript_path(asset, new_theme_name = self.theme_name)
  digest_for_javascript("#{asset}.js", new_theme_name)
end


55
56
57
58
59
60
61
62
# File 'lib/themes_for_rails/digested_action_view.rb', line 55

def theme_stylesheet_link_tag(*files)
  options = files.extract_options!
  options.merge!({ :type => "text/css" })
  files_with_options = files.collect {|file| theme_stylesheet_path(file) }
  files_with_options += [options]

  stylesheet_link_tag(*files_with_options)
end

#theme_stylesheet_path(asset, new_theme_name = self.theme_name) ⇒ Object



25
26
27
# File 'lib/themes_for_rails/digested_action_view.rb', line 25

def theme_stylesheet_path(asset, new_theme_name = self.theme_name)
  digest_for_stylesheet("#{asset}.css", new_theme_name)
end