Sha256: 180647e39976a8c4c63fae5705e2fc45cf15dee2329709473c62abb28f8263b5

Contents?: true

Size: 573 Bytes

Versions: 1

Compression:

Stored size: 573 Bytes

Contents

module Kuhsaft
  class PagesController < ::ApplicationController
    respond_to :html

    def show
      url = locale.to_s
      url += "/#{params[:url]}" if params[:url].present?
      @page = Kuhsaft::Page.find_by_url(url)

      if @page.present? && @page.redirect? && @page.redirect_url.present?
        redirect_to "/#{@page.redirect_url}"
      elsif @page.present?
        respond_with @page
      elsif @page.blank? && respond_to?(:handle_404)
        handle_404
      else
        raise ActionController::RoutingError.new('Not Found')
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kuhsaft-1.6.0 app/controllers/kuhsaft/pages_controller.rb