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
# File 'lib/themes_for_rails/action_view.rb', line 20

def current_theme_image_path(asset)
  base_theme_image_path(:theme => self.theme_name, :asset => asset)
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 => "#{asset}.js")
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 => "#{asset}.css")
end

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



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

def theme_image_path(asset, new_theme_name = self.theme_name)
  base_theme_image_path(:theme => new_theme_name, :asset => asset)
end

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



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

def theme_image_submit_tag(source, options = {})
  image_submit_tag(theme_image_path(source), options)
end

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



36
37
38
# File 'lib/themes_for_rails/action_view.rb', line 36

def theme_image_tag(source, options = {})
  image_tag(theme_image_path(source), options)
end

#theme_javascript_include_tag(*files) ⇒ Object



44
45
46
47
48
49
50
51
# File 'lib/themes_for_rails/action_view.rb', line 44

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



28
29
30
# File 'lib/themes_for_rails/action_view.rb', line 28

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


53
54
55
56
57
58
59
60
# File 'lib/themes_for_rails/action_view.rb', line 53

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



24
25
26
# File 'lib/themes_for_rails/action_view.rb', line 24

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