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, #mark_active_action

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



16
17
18
19
20
21
# File 'app/controllers/hyrax/collections_controller.rb', line 16

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