Module: Rearview::ApplicationHelper

Defined in:
app/helpers/rearview/application_helper.rb

Instance Method Summary collapse

Instance Method Details

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



16
17
18
19
20
# File 'app/helpers/rearview/application_helper.rb', line 16

def rearview_img_tag(source,options={})
  options = options.symbolize_keys
  options[:src] = rearview_static_path("/img"+source)
  tag("img", options)
end


11
12
13
14
15
# File 'app/helpers/rearview/application_helper.rb', line 11

def rearview_link_tag(href,options={})
  options = options.symbolize_keys
  options[:href] = rearview_static_path(href)
  tag("link",options)
end

#rearview_static_path(segment = nil) ⇒ Object



3
4
5
6
7
8
9
10
# File 'app/helpers/rearview/application_helper.rb', line 3

def rearview_static_path(segment=nil)
  prefix = if Rails.env.development?
           "/rearview-src"
           else
           "/rearview"
           end
  ( segment.present? ? prefix + segment : prefix )
end