Class: Hyrax::CollectionsController

Inherits:
ApplicationController
  • Object
show all
Includes:
BreadcrumbsForCollections, CollectionsControllerBehavior
Defined in:
app/controllers/hyrax/collections_controller.rb

Instance Method Summary collapse

Methods included from BreadcrumbsForCollections

#add_breadcrumb_for_action, #add_breadcrumb_for_controller

Methods included from Breadcrumbs

#add_breadcrumb_for_action, #add_breadcrumb_for_controller, #build_breadcrumbs, #default_trail, #trail_from_referer

Methods included from CollectionsControllerBehavior

#collection, #show

Instance Method Details

#filesObject

Renders a JSON response with a list of files in this collection This is used by the edit form to populate the thumbnail_id dropdown



12
13
14
15
16
17
# File 'app/controllers/hyrax/collections_controller.rb', line 12

def files
  result = form.select_files.map do |label, id|
    { id: id, text: label }
  end
  render json: result
end