Class: ActiveCanvas::PagesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/active_canvas/pages_controller.rb

Instance Method Summary collapse

Instance Method Details

#homeObject



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

def home
  @page = Setting.homepage

  if @page
    render :show
  else
    render :no_homepage
  end
end

#showObject

Raises:

  • (ActionController::RoutingError)


13
14
15
16
# File 'app/controllers/active_canvas/pages_controller.rb', line 13

def show
  @page = Page.published.find_by(slug: params[:slug])
  raise ActionController::RoutingError, "Not Found" unless @page
end