Class: Spree::PagesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/pages_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject

Raises:

  • (ActionController::RoutingError)


3
4
5
6
7
8
9
10
11
# File 'app/controllers/spree/pages_controller.rb', line 3

def show
  @page = current_page
  raise ActionController::RoutingError.new("No route matches [GET] #{request.fullpath}") if @page.nil? 
  if @page.root?
    @posts    = Spree::Post.live.limit(5)    if SpreeEssentials.has?(:blog)
    @articles = Spree::Article.live.limit(5) if SpreeEssentials.has?(:news)
    render :template => 'spree/pages/home'
  end
end