Class: Hyrax::AdminSetOptionsPresenter
- Inherits:
-
Object
- Object
- Hyrax::AdminSetOptionsPresenter
- Defined in:
- app/presenters/hyrax/admin_set_options_presenter.rb
Overview
Presents the options for the AdminSet widget on the create/edit form
Instance Method Summary collapse
-
#initialize(service) ⇒ AdminSetOptionsPresenter
constructor
A new instance of AdminSetOptionsPresenter.
-
#select_options(access = :deposit) ⇒ Object
Return AdminSet selectbox options based on access type.
Constructor Details
#initialize(service) ⇒ AdminSetOptionsPresenter
Returns a new instance of AdminSetOptionsPresenter.
7 8 9 |
# File 'app/presenters/hyrax/admin_set_options_presenter.rb', line 7 def initialize(service) @service = service end |
Instance Method Details
#select_options(access = :deposit) ⇒ Object
TODO:
this hits the Solr from the view. it would be better to avoid this.
Return AdminSet selectbox options based on access type
16 17 18 19 20 |
# File 'app/presenters/hyrax/admin_set_options_presenter.rb', line 16 def (access = :deposit) @service.search_results(access).map do |admin_set| [admin_set.to_s, admin_set.id, data_attributes(admin_set)] end end |