Class: Kuhsaft::PagesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Kuhsaft::PagesController
- Defined in:
- app/controllers/kuhsaft/pages_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
5 6 7 8 9 10 |
# File 'app/controllers/kuhsaft/pages_controller.rb', line 5 def index @search = params[:search] if @search.present? @pages = Kuhsaft::Page.unscoped.published.content_page.search(@search) end end |
#show ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/kuhsaft/pages_controller.rb', line 12 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 |