Module: FeedBuilder::Rails::Controller

Included in:
ActionController::Base
Defined in:
lib/feedbuilder-rails/controller.rb

Instance Method Summary collapse

Instance Method Details

#feed_url_builder(*args) ⇒ Object



11
12
13
# File 'lib/feedbuilder-rails/controller.rb', line 11

def feed_url_builder(*args)
  FeedBuilder::UrlBuilder.new(*args)
end

#send_feed(filename, options = {}, &block) ⇒ Object



4
5
6
7
8
9
# File 'lib/feedbuilder-rails/controller.rb', line 4

def send_feed(filename, options = {}, &block)
  if ::Rails.env == 'development' || stale?(options)
    feed ||= yield if block_given?
    send_data(feed.to_xml, :filename => filename, :type => :atom, :disposition => 'inline')
  end
end