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, current_ability: service.context.current_ability) ⇒ AdminSetOptionsPresenter
constructor
A new instance of AdminSetOptionsPresenter.
-
#select_options(access = :deposit) ⇒ Object
Return AdminSet selectbox options based on access type.
Constructor Details
#initialize(service, current_ability: service.context.current_ability) ⇒ AdminSetOptionsPresenter
Returns a new instance of AdminSetOptionsPresenter.
7 8 9 10 |
# File 'app/presenters/hyrax/admin_set_options_presenter.rb', line 7 def initialize(service, current_ability: service.context.current_ability) @service = service @current_ability = current_ability 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
17 18 19 20 21 |
# File 'app/presenters/hyrax/admin_set_options_presenter.rb', line 17 def (access = :deposit) @service.search_results(access).map do |admin_set| [admin_set.to_s, admin_set.id, data_attributes(admin_set)] end end |