Sha256: b512c55b652a4f37f0aa55d96ed39ed0a810fd6799dd39b8b2010750dd32f803

Contents?: true

Size: 603 Bytes

Versions: 1

Compression:

Stored size: 603 Bytes

Contents

class HighVoltage::PagesController < ApplicationController
  layout Proc.new { |_| HighVoltage.layout }

  rescue_from ActionView::MissingTemplate do |exception|
    if exception.message =~ %r{Missing template #{page_finder.content_path}}
      raise ActionController::RoutingError, "No such page: #{params[:id]}"
    else
      raise exception
    end
  end

  def show
    render :template => current_page
  end

  private

  def current_page
    page_finder.find
  end

  def page_finder
    page_finder_factory.new(params[:id])
  end

  def page_finder_factory
    HighVoltage::PageFinder
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
high_voltage-1.2.3 app/controllers/high_voltage/pages_controller.rb