Class: ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Includes:
TranslationCms::Authenticate
Defined in:
app/controllers/application_controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.caches_page_with_cache_marker(*args, &block) ⇒ Object

add will_cached marker on page caches_page



234
235
236
237
238
239
240
241
# File 'app/controllers/application_controller.rb', line 234

def caches_page_with_cache_marker(*args, &block)
  actions = args.dup
  options = actions.extract_options!
  append_before_action({ only: actions }.merge(options)) do
    @will_cached = true if perform_caching
  end
  caches_page_without_cache_marker(*args, &block)
end

Instance Method Details

#raise_not_found!Object

Called by last route matching unmatched routes. Raises RoutingError which will be rescued from in the same way as other exceptions.

Raises:

  • (ActionController::RoutingError)


30
31
32
# File 'app/controllers/application_controller.rb', line 30

def raise_not_found!
  raise ActionController::RoutingError, "No route matches #{params[:unmatched_route]}"
end