Sha256: 5c8ffac9532554a4637c9089a81a13796b696b8f48b5abf85203df404e86e04d

Contents?: true

Size: 391 Bytes

Versions: 2

Compression:

Stored size: 391 Bytes

Contents

class HighVoltage::PagesController < ApplicationController

  unloadable

  rescue_from ActionView::MissingTemplate, :with => :invalid_page

  def show
    render :template => current_page
  end

  protected

    def invalid_page
      raise ActionController::RoutingError, "No such page: #{params[:id]}"
    end

    def current_page
      "pages/#{params[:id].to_s.downcase}"
    end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
high_voltage-0.9.3 app/controllers/high_voltage/pages_controller.rb
high_voltage-0.9.2 app/controllers/high_voltage/pages_controller.rb