app/controllers/spotlight/exhibits_controller.rb in blacklight-spotlight-3.0.0.alpha.2 vs app/controllers/spotlight/exhibits_controller.rb in blacklight-spotlight-3.0.0.alpha.3
- old
+ new
@@ -4,11 +4,11 @@
##
# Administrative CRUD actions for an exhibit
class ExhibitsController < Spotlight::ApplicationController
include Spotlight::SearchHelper
before_action :authenticate_user!, except: [:index]
- before_action :set_tab, only: [:edit, :update]
+ before_action :set_tab, only: %i[edit update]
load_and_authorize_resource
def index
@published_exhibits = @exhibits.includes(:thumbnail).published.ordered_by_weight.page(params[:page])
@@ -81,21 +81,21 @@
end
protected
def current_exhibit
- @exhibit if @exhibit && @exhibit.persisted?
+ @exhibit if @exhibit&.persisted?
end
def exhibit_params
params.require(:exhibit).permit(
:title,
:subtitle,
:description,
:published,
:tag_list,
- contact_emails_attributes: [:id, :email],
- languages_attributes: [:id, :public]
+ contact_emails_attributes: %i[id email],
+ languages_attributes: %i[id public]
)
end
def set_tab
@tab = params[:tab]