class Ecrire::ThemeController
The class any controller in a theme needs to inherit from
ThemeController
provides boilerplate code so the blog handles a few cases for you.
Ecrire
will try to redirect to the homepage when it meets selected exceptions Currently, the following 3 exceptions are handled:
-
ActiveRecord::RecordNotFound
-
ActionController::RoutingError
-
ActionView::ActionViewError
Private Instance Methods
pagination()
click to toggle source
# File lib/ecrire/app/controllers/ecrire/theme_controller.rb, line 27 def pagination params[:per] ||= 10 params[:page] ||= 1 end
redirect_home(exception)
click to toggle source
# File lib/ecrire/app/controllers/ecrire/theme_controller.rb, line 32 def redirect_home(exception) flash[:errors] = t('errors.request.not_found') redirect_to '/' end