Methods
Class Public methods
Instance Public methods
Creates an entry tag for a specific record and prefills the id using class and id.
Options:
- :published: Time first published. Defaults to the created_at attribute on the record if one such exists.
- :updated: Time of update. Defaults to the updated_at attribute on the record if one such exists.
- :url: The URL for this entry. Defaults to the polymorphic_url for the record.
- :id: The ID for this entry. Defaults to “tag:#{@view.request.host},#{@feed_options[:schema_date]}:#{record.class}/#{record.id}“
# File actionpack/lib/action_view/helpers/atom_feed_helper.rb, line 179 179: def entry(record, options = {}) 180: @xml.entry do 181: @xml.id(options[:id] || "tag:#{@view.request.host},#{@feed_options[:schema_date]}:#{record.class}/#{record.id}") 182: 183: if options[:published] || (record.respond_to?(:created_at) && record.created_at) 184: @xml.published((options[:published] || record.created_at).xmlschema) 185: end 186: 187: if options[:updated] || (record.respond_to?(:updated_at) && record.updated_at) 188: @xml.updated((options[:updated] || record.updated_at).xmlschema) 189: end 190: 191: @xml.link(:rel => 'alternate', :type => 'text/html', :href => options[:url] || @view.polymorphic_url(record)) 192: 193: yield AtomBuilder.new(@xml) 194: end 195: end
Accepts a Date or Time object and inserts it in the proper format. If nil is passed, current time in UTC is used.