Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: c6964f7e7b
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (26 sloc) 0.783 kb
class HighVoltage::PagesController < ApplicationController
unloadable
layout HighVoltage::layout
rescue_from ActionView::MissingTemplate do |exception|
if exception.message =~ %r{Missing template #{HighVoltage::content_path}}
begin
render :template => "#{current_page}/index", :layout => HighVoltage::layout
rescue ActionView::MissingTemplate => e
raise ActionController::RoutingError, "No such page: #{params[:id]}"
end
else
raise exception
end
end
def show
render :template => current_page, :layout => HighVoltage::layout
end
protected
def current_page
"#{HighVoltage::content_path}#{clean_path}"
end
def clean_path
path = Pathname.new "/#{params[:id]}"
path.cleanpath.to_s[1..-1]
end
end
Jump to Line
Something went wrong with that request. Please try again.