Module: Ress::ViewHelpers

Defined in:
lib/ress/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#ress_annotation_tags(options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ress/view_helpers.rb', line 5

def ress_annotation_tags(options={})
  fullpath = options[:fullpath] || request.fullpath

  path = "#{request.host_with_port}#{fullpath}"
  html = if canonical_request?
    path.gsub!("#{request.subdomain}.", '') if Ress.replace_canonical_subdomain?
    Ress.alternate_versions.map do |category|
      category.link_tag(request.protocol, path, self)
    end.join
  else
    Ress.canonical_version.link_tag(request.protocol, path, request.subdomain, self)
  end

  # Append the modernizr script tag if need be.
  if Ress.include_modernizr?
    html << self.javascript_include_tag("ress_modernizr_build")
  end

  html.html_safe

end