Method: ApplicationController#render_feed

Defined in:
app/controllers/application_controller.rb

#render_feed(items, options = {}) ⇒ Object



618
619
620
621
622
623
624
625
# File 'app/controllers/application_controller.rb', line 618

def render_feed(items, options={})
  @items = (items || []).to_a
  @items.sort! {|x, y| y.event_datetime <=> x.event_datetime}
  @items = @items.slice(0, Setting.feeds_limit.to_i)
  @title = options[:title] || Setting.app_title
  render :template => "common/feed", :formats => [:atom], :layout => false,
         :content_type => 'application/atom+xml'
end