Sha256: 66e449157dbddcaf91af211b249327441b98ec433a05b3d7ac31e2f4561c9b01

Contents?: true

Size: 585 Bytes

Versions: 12

Compression:

Stored size: 585 Bytes

Contents

module Kuhsaft
  class PagesController < ApplicationController
    
    respond_to :html
    before_filter :complete_url
    
    def show
      @page = Kuhsaft::Page.find_by_url(params[:url])
      if @page.present?
        respond_with @page
      else
        if respond_to?(:handle_404)
          handle_404
        else
          raise ActionController::RoutingError.new('Not Found')
        end
      end
    end
    
    private
    def complete_url
      params[:url] = "#{params[:locale]}/#{params[:url]}" if params[:url].present? && params[:locale].present?
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
kuhsaft-0.3.4.legacy3 app/controllers/kuhsaft/pages_controller.rb
kuhsaft-0.3.4.legacy2 app/controllers/kuhsaft/pages_controller.rb
kuhsaft-0.3.4.legacy app/controllers/kuhsaft/pages_controller.rb
kuhsaft-0.3.6 app/controllers/kuhsaft/pages_controller.rb
kuhsaft-0.3.5 app/controllers/kuhsaft/pages_controller.rb
kuhsaft-0.3.4 app/controllers/kuhsaft/pages_controller.rb
kuhsaft-0.3.4.rc2 app/controllers/kuhsaft/pages_controller.rb
kuhsaft-0.3.4.rc1 app/controllers/kuhsaft/pages_controller.rb
kuhsaft-0.3.3 app/controllers/kuhsaft/pages_controller.rb
kuhsaft-0.3.2 app/controllers/kuhsaft/pages_controller.rb
kuhsaft-0.2.5 app/controllers/kuhsaft/pages_controller.rb
kuhsaft-0.2.4 app/controllers/kuhsaft/pages_controller.rb