Skip to content
Browse files

added fallback for index page

  • Loading branch information...
1 parent 012a65b commit 8c06a7d7fef3584a7e528c07f3aa5a886ac2ffbd @ludicast committed Oct 25, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 app/controllers/high_voltage/pages_controller.rb
View
8 app/controllers/high_voltage/pages_controller.rb
@@ -5,8 +5,12 @@ class HighVoltage::PagesController < ApplicationController
rescue_from ActionView::MissingTemplate do |exception|
if exception.message =~ %r{Missing template #{HighVoltage::content_path}}
- raise ActionController::RoutingError, "No such page: #{params[:id]}"
- else
+ 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

0 comments on commit 8c06a7d

Please sign in to comment.
Something went wrong with that request. Please try again.