Module: SitemapsHelper

Defined in:
app/helpers/sitemaps_helper.rb

Instance Method Summary collapse

Instance Method Details

#xml_article_url(object) ⇒ Object



17
18
19
# File 'app/helpers/sitemaps_helper.rb', line 17

def xml_article_url(object)
  news_article_url(object.route_params)
end

#xml_lastmod(object) ⇒ Object



2
3
4
# File 'app/helpers/sitemaps_helper.rb', line 2

def xml_lastmod(object)
  object.updated_at.xmlschema
end

#xml_url(object) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'app/helpers/sitemaps_helper.rb', line 6

def xml_url(object)
  if object.respond_to? :path
    "http://#{SITE_DOMAIN}#{object.path}"
  elsif object.respond_to? :route_params
    object_name = ActionController::RecordIdentifier::singular_class_name(object)
    self.send("#{object_name}_url", object.route_params) 
  else
    polymorphic_url(object)
  end
end