Sha256: b82b6cee2f1da59d3efd31a8def62f10eee54b04422d0c5ae7b8092740b9f68b
Contents?: true
Size: 823 Bytes
Versions: 1
Compression:
Stored size: 823 Bytes
Contents
# # Blogaze # Copyright (C) 2011-2013 Jack Polgar # # Blogaze is released under the BSD 3-clause license. # @license http://opensource.org/licenses/BSD-3-Clause # module Blogaze class Pages < Controller map '/pages' def view(slug = nil) if slug == nil slug = request.env["REQUEST_PATH"] end # Chomp chomp chomp, let's trim any unwanted # forward slashes from the begning and end of the url. slug = slug.chomp("/").reverse.chomp("/").reverse @page = Page[:slug => slug] # Check if the page exists, if not render the # not found page. if !@page.respond_to?('title') respond(view_file('pages/notfound')) else @title = "#{@page.title} - #{@settings[:title]}" respond(view_file('pages/page')) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
blogaze-0.0.1 | lib/blogaze/controller/pages.rb |