Class: Maglev::PagesController

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

Instance Method Summary collapse

Instance Method Details

#viewObject

Generic Page Viewing GET /:slug



8
9
10
11
12
13
# File 'app/controllers/maglev/pages_controller.rb', line 8

def view
  @slug = params[:slug]
  @template = @slug ? @slug.gsub('-','_') : 'index'
  @layout = params[:layout] || Maglev.default_layout
  render template: "/site/#{@template}", layout: "/layouts/#{@layout}"
end