diff --git a/app/controllers/hyrax/my/works_controller.rb b/app/controllers/hyrax/my/works_controller.rb index cdf0e1bb2f..f809ce25b3 100644 --- a/app/controllers/hyrax/my/works_controller.rb +++ b/app/controllers/hyrax/my/works_controller.rb @@ -11,6 +11,9 @@ def search_builder_class end def index + # The user's collections for the "add to collection" form + @user_collections = collections_service.search_results(:edit) + add_breadcrumb t(:'hyrax.controls.home'), root_path add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path add_breadcrumb t(:'hyrax.admin.sidebar.works'), hyrax.my_works_path @@ -20,6 +23,10 @@ def index private + def collections_service + Hyrax::CollectionsService.new(self) + end + def search_action_url(*args) hyrax.my_works_url(*args) end diff --git a/app/controllers/hyrax/my_controller.rb b/app/controllers/hyrax/my_controller.rb index b7411f47bc..296113fce2 100644 --- a/app/controllers/hyrax/my_controller.rb +++ b/app/controllers/hyrax/my_controller.rb @@ -31,10 +31,6 @@ def self.configure_facets helper_method :suppressed_to_status def index - # The user's collections for the "add to collection" form - # TODO: could this be only on the My::WorksController? - @user_collections = collections_service.search_results(:edit) - @user = current_user (@response, @document_list) = query_solr prepare_instance_variables_for_batch_control_display @@ -57,10 +53,6 @@ def suppressed_to_status(value) private - def collections_service - Hyrax::CollectionsService.new(self) - end - # TODO: Extract a presenter object that wrangles all of these instance variables. def prepare_instance_variables_for_batch_control_display # set up some parameters for allowing the batch controls to show appropriately