Class: UuidsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/uuids_controller.rb

Overview

rubocop:todo Style/Documentation

Constant Summary

Constants included from FlashTruncation

FlashTruncation::STRING_OVERHEAD

Instance Method Summary collapse

Methods inherited from ApplicationController

#block_api_access, #evil_parameter_hack!, #extract_header_info, #set_cache_disabled!

Methods included from FlashTruncation

#max_flash_size, #truncate_flash, #truncate_flash_array

Instance Method Details

#showObject


3
4
5
6
7
8
9
10
11
12
# File 'app/controllers/uuids_controller.rb', line 3

def show
  uuid = Uuid.find_by!(external_id: params[:id])

  # We need to override the automatic path finding for
  # a resource here as our controllers are a little inconsistent
  # and assets especially end up getting redirected to undesired
  # locations. This line basically coerces a resource to its
  # base class, ensuring it ends up at the correct controller.
  redirect_to(uuid.resource.becomes uuid.resource.class.base_class)
end