public
Description: Rails Sitemap Plugin / Site Map Plugin for Rails. A beautiful rails sitemap plugin that talks to Google, Yahoo and MSN when updated. Sitemap features clean handcrafted XHTML, XML with XSLT and custom finder options for your named routes.
Clone URL: git://github.com/queso/sitemap.git
Search Repo:
queso (author)
Sat Mar 22 21:36:53 -0700 2008
commit  9cce400650ff04e69e76003fa84ccd140c694336
tree    7b6bd506a607de5c58cd9887d98b9f090c39343c
parent  47cc099d266ece9260d66a523ec5d926cb66c567
sitemap / lib / sitemap_widget.rb
100644 25 lines (18 sloc) 0.522 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class SitemapWidget < ActiveRecord::Base
  
  def self.priorities
    [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
  end
  
  def self.frequencies
    [["Always", "always"], ["Daily", "daily"], ["Weekly", "weekly"], ["Monthly", "monthly"], ["Yearly", "yearly"]]
  end
 
  def find_children(options = {})
    @finder = finder
    widget_model_constant.send @finder, :all, options
  end
  
  def widget_model_constant
    widget_model.constantize
  end
  
  def finder
    (custom_finder || "find").to_sym
  end
  
end