Changeset 9044
- Timestamp:
- 03/17/08 04:46:33 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_view/helpers/atom_feed_helper.rb
r8637 r9044 27 27 # 28 28 # app/views/posts/index.atom.builder: 29 # atom_feed (:tag_uri => "2008")do |feed|29 # atom_feed do |feed| 30 30 # feed.title("My great blog!") 31 31 # feed.updated((@posts.first.created_at)) … … 45 45 # The options for atom_feed are: 46 46 # 47 # * <tt>:schema_date</tt>: Required. The date at which the tag scheme for the feed was first used. A good default is the year you created the feed. See http://feedvalidator.org/docs/error/InvalidTAG.html for more information.48 47 # * <tt>:language</tt>: Defaults to "en-US". 49 48 # * <tt>:root_url</tt>: The HTML alternative that this feed is doubling for. Defaults to / on the current host. 50 49 # * <tt>:url</tt>: The URL for this feed. Defaults to the current URL. 50 # * <tt>:schema_date</tt>: The date at which the tag scheme for the feed was first used. A good default is the year you 51 # created the feed. See http://feedvalidator.org/docs/error/InvalidTAG.html for more information. If not specified, 52 # 2005 is used (as a "I don't care"-value). 51 53 # 52 54 # Other namespaces can be added to the root element: … … 75 77 # atom_feed yields an AtomFeedBuilder instance. 76 78 def atom_feed(options = {}, &block) 77 if options[:schema_date] .blank?78 logger.warn("You must provide the :schema_date option to atom_feed for your feed to be valid. A good default is the year you first created this feed.") unless logger.nil?79 if options[:schema_date] 80 options[:schema_date] = options[:schema_date].strftime("%Y-%m-%d") if options[:schema_date].respond_to?(:strftime) 79 81 else 80 options[:schema_date] = options[:schema_date].strftime("%Y-%m-%d") if options[:schema_date].respond_to?(:strftime)82 options[:schema_date] = "2005" # The Atom spec copyright date 81 83 end 82 84