Module: Espresso::Controller::InheritedResourcesModifications::ClassMethods
- Defined in:
- lib/espresso/controller/inherited_resources.rb
Instance Method Summary collapse
-
#has_feed(*args) ⇒ Object
Adds ability to build feeds for resource’s collections.
Instance Method Details
#has_feed(*args) ⇒ Object
Adds ability to build feeds for resource’s collections. By default adds Atom feed
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/espresso/controller/inherited_resources.rb', line 63 def has_feed(*args) require 'has_scope' = args. if .empty? [:only] = :index end class_inheritable_accessor(:feed_formats) unless respond_to?(:feed_formats) self.feed_formats = (args.empty? ? [:atom] : args).map(&:to_s) self.feed_formats.each do |format| respond_to format, end include FeedScope has_scope(:for_feed, .merge(:default => true, :type => :boolean, :if => :feed_scope_applicable?)) end |