Class: SkeletonLoader::SkeletonLoaderController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/skeleton_loader/skeleton_loader_controller.rb

Overview

Handles async requests to generate and render loading skeletons

Instance Method Summary collapse

Instance Method Details

#showObject



6
7
8
9
10
11
12
13
# File 'app/controllers/skeleton_loader/skeleton_loader_controller.rb', line 6

def show
  content_id = params[:content_id]
  mode = params[:mode]
  wrapped_content = mode == "custom" ? handle_custom_template(content_id) : handle_predefined_template(content_id)
  render html: wrapped_content
rescue StandardError => e
  handle_error(e)
end