Module: Rearview::ApplicationHelper
- Defined in:
- app/helpers/rearview/application_helper.rb
Instance Method Summary collapse
- #rearview_img_tag(source, options = {}) ⇒ Object
- #rearview_link_tag(href, options = {}) ⇒ Object
- #rearview_static_path(segment = nil) ⇒ Object
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,={}) = .symbolize_keys [:src] = rearview_static_path("/img"+source) tag("img", ) end |
#rearview_link_tag(href, options = {}) ⇒ Object
11 12 13 14 15 |
# File 'app/helpers/rearview/application_helper.rb', line 11 def rearview_link_tag(href,={}) = .symbolize_keys [:href] = rearview_static_path(href) tag("link",) 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 |