Sha256: c012c7cadcb4f7e336f00c1d074bb700f4fcfd4419120aada80dcfef2343b067

Contents?: true

Size: 341 Bytes

Versions: 2

Compression:

Stored size: 341 Bytes

Contents

class RecentProductsPortlet < Cms::Portlet

  description "Displays the most recent products from the shop."

  # Mark this as 'true' to allow the portlet's template to be editable via the CMS admin UI.
  enable_template_editor false
     
  def render
    @products = Spree::Product.order("created_at desc").limit(self.limit)
  end
    
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bcms_spree-0.0.2 app/portlets/recent_products_portlet.rb
bcms_spree-0.0.1 app/portlets/recent_products_portlet.rb