Class: Hyrax::SelectTypePresenter
- Inherits:
-
Object
- Object
- Hyrax::SelectTypePresenter
- Defined in:
- app/presenters/hyrax/select_type_presenter.rb
Instance Attribute Summary collapse
-
#concern ⇒ Object
readonly
Returns the value of attribute concern.
Instance Method Summary collapse
- #description ⇒ Object
- #icon_class ⇒ Object
-
#initialize(concern) ⇒ SelectTypePresenter
constructor
A new instance of SelectTypePresenter.
- #name ⇒ Object
- #switch_to_batch_upload_path(route_set:, params:) ⇒ Object
- #switch_to_new_work_path(route_set:, params:) ⇒ Object
Constructor Details
#initialize(concern) ⇒ SelectTypePresenter
Returns a new instance of SelectTypePresenter.
3 4 5 |
# File 'app/presenters/hyrax/select_type_presenter.rb', line 3 def initialize(concern) @concern = concern end |
Instance Attribute Details
#concern ⇒ Object (readonly)
Returns the value of attribute concern.
7 8 9 |
# File 'app/presenters/hyrax/select_type_presenter.rb', line 7 def concern @concern end |
Instance Method Details
#description ⇒ Object
13 14 15 |
# File 'app/presenters/hyrax/select_type_presenter.rb', line 13 def description translate('description') end |
#icon_class ⇒ Object
9 10 11 |
# File 'app/presenters/hyrax/select_type_presenter.rb', line 9 def icon_class ModelIcon.css_class_for(concern) end |
#name ⇒ Object
17 18 19 |
# File 'app/presenters/hyrax/select_type_presenter.rb', line 17 def name translate('name') end |
#switch_to_batch_upload_path(route_set:, params:) ⇒ Object
29 30 31 32 33 34 35 |
# File 'app/presenters/hyrax/select_type_presenter.rb', line 29 def switch_to_batch_upload_path(route_set:, params:) if params.key?(:add_works_to_collection) route_set.new_batch_upload_path(payload_concern: concern, add_works_to_collection: params[:add_works_to_collection]) else route_set.new_batch_upload_path(payload_concern: concern) end end |
#switch_to_new_work_path(route_set:, params:) ⇒ Object
21 22 23 24 25 26 27 |
# File 'app/presenters/hyrax/select_type_presenter.rb', line 21 def switch_to_new_work_path(route_set:, params:) if params.key?(:add_works_to_collection) route_set.new_polymorphic_path(concern, add_works_to_collection: params[:add_works_to_collection]) else route_set.new_polymorphic_path(concern) end end |