app/controllers/kuhsaft/pages_controller.rb in kuhsaft-1.4.3 vs app/controllers/kuhsaft/pages_controller.rb in kuhsaft-1.5.0

- old
+ new

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