Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10619: atom_feed_helper_patch.diff

File atom_feed_helper_patch.diff, 1.4 kB (added by matt, 7 months ago)
  • atom_feed_helper/lib/atom_feed_helper.rb

    old new  
    2727        @xml, @view = xml, view 
    2828      end 
    2929 
    30       def entry(record
     30      def entry(record, options = {}
    3131        @xml.entry do  
    3232          @xml.id("tag:#{@view.request.host_with_port},2007:#{record.class}#{record.id}") 
    3333          @xml.published(record.created_at.xmlschema) if record.respond_to?(:created_at) 
     
    3535 
    3636          yield @xml 
    3737 
    38           @xml.link(:rel => 'alternate', :type => 'text/html', :href => @view.polymorphic_url(record)) 
     38          if options[:entry_url] || @view.respond_to?(:polymorphic_url) 
     39             @xml.link(:rel => 'alternate', :type => 'text/html', :href => options[:entry_url] || @view.polymorphic_url(record)) 
     40          end 
    3941        end 
    4042      end 
    4143 
  • atom_feed_helper/CHANGELOG

    old new