diff --git a/app/controllers/experiments_controller.rb b/app/controllers/experiments_controller.rb index ea3115e33..50f6c1c4f 100644 --- a/app/controllers/experiments_controller.rb +++ b/app/controllers/experiments_controller.rb @@ -94,8 +94,11 @@ class ExperimentsController < ApplicationController @current_sort = view_state.state.dig('my_modules', view_mode, 'sort') || 'atoz' @project = @experiment.project - @archived_modules = @experiment.my_modules.archived.order(:name) - @active_modules = @experiment.my_modules.active.order(:name) + if params[:view_mode] == 'archived' + @my_modules = @experiment.my_modules.archived.order(:name) + else + @my_modules = @experiment.my_modules.active.order(:name) + end end def load_table diff --git a/app/views/experiments/table.html.erb b/app/views/experiments/table.html.erb index 7565c3124..b668eefa2 100644 --- a/app/views/experiments/table.html.erb +++ b/app/views/experiments/table.html.erb @@ -3,14 +3,8 @@ <% provide(:sidebar_url, sidebar_experiment_path(@experiment)) %> <% provide(:container_class, 'no-second-nav-container') %> -<% if params[:view_mode] == "archived" %> - <%= content_for :sidebar do %> - <%= render partial: 'shared/sidebar/archived_my_modules.html.erb', locals: { experiment: @experiment, my_modules: @archived_modules } %> - <% end %> -<% else %> - <%= content_for :sidebar do %> - <%= render partial: 'shared/sidebar/my_modules.html.erb', locals: { experiment: @experiment, my_modules: @active_modules } %> - <% end %> +<%= content_for :sidebar do %> + <%= render partial: 'shared/sidebar/my_modules.html.erb', locals: { experiment: @experiment, my_modules: @my_modules } %> <% end %>