Sha256: 1f24103480f959fcbeaba3d7dd8e0e2c0c34ed560ad69b6346e65d17b8ab2f30

Contents?: true

Size: 424 Bytes

Versions: 1

Compression:

Stored size: 424 Bytes

Contents

Spree::ProductsController.class_eval do
  respond_to :rss, :only => [:index]
  before_filter :check_rss, only: :index

  def check_rss
    if request.format.rss?
      @products = Spree::Product.all
      respond_to do |format|
        format.rss { render 'spree/products/index.rss', :layout => false }
      end
    end
  end

  # caches_page :index, :if => Proc.new {|c| c.request.format.rss? }, :expires_in => 1.days
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_product_feed-0.1.0 app/controllers/spree/products_controller_decorator.rb