Module: ThemesForRails::ActionView

Extended by:
ActiveSupport::Concern
Defined in:
lib/themes_for_rails/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/action_view.rb', line 20

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

#current_theme_javascript_path(asset) ⇒ Object



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

def current_theme_javascript_path(asset)
  base_theme_javascript_path(:theme => self.theme_name, :asset => digest_for_javascript("#{asset}.js", self.theme_name))
end

#current_theme_stylesheet_path(asset) ⇒ Object



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

def current_theme_stylesheet_path(asset)
  base_theme_stylesheet_path(:theme => self.theme_name, :asset => digest_for_stylesheet("#{asset}.css", self.theme_name))
end

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



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

def theme_image_path(asset, new_theme_name = self.theme_name)
  image, extension = name_ext(asset)
  base_theme_image_path(:theme => new_theme_name, :asset => digest_for_image("#{image}.#{extension}", new_theme_name))
end

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



43
44
45
46
# File 'lib/themes_for_rails/action_view.rb', line 43

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

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



38
39
40
41
# File 'lib/themes_for_rails/action_view.rb', line 38

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

#theme_javascript_include_tag(*files) ⇒ Object



48
49
50
51
52
53
54
55
# File 'lib/themes_for_rails/action_view.rb', line 48

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/action_view.rb', line 29

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


57
58
59
60
61
62
63
64
# File 'lib/themes_for_rails/action_view.rb', line 57

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/action_view.rb', line 25

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