app/controllers/spotlight/pages_controller.rb in blacklight-spotlight-3.5.0.4 vs app/controllers/spotlight/pages_controller.rb in blacklight-spotlight-3.6.0.beta1
- old
+ new
@@ -72,11 +72,11 @@
# PATCH/PUT /pages/1
def update
@page.lock&.delete
if @page.update(page_params.merge(last_edited_by: current_user))
- redirect_to [spotlight, @page.exhibit, @page, format: params.permit(:format)], flash: { html_safe: true }, notice: undo_notice(:updated)
+ redirect_to [spotlight, @page.exhibit, @page, { format: params.permit(:format) }], flash: { html_safe: true }, notice: undo_notice(:updated)
else
render action: 'edit'
end
end
@@ -126,11 +126,12 @@
def undo_link
return unless can? :manage, @page
return if @page.versions.blank?
- view_context.link_to(t(:'spotlight.versions.undo'), revert_version_path(@page.versions.last), method: :post)
+ view_context.link_to(t(:'spotlight.versions.undo'), revert_version_path(@page.versions.last),
+ data: { method: :post, turbo_method: :post })
end
def undo_notice(key)
view_context.safe_join([t(:"helpers.submit.page.#{key}", model: @page.class.model_name.human.downcase), undo_link], ' ')
end
@@ -148,10 +149,10 @@
def page_attributes
%i[id published title weight display_sidebar parent_page_id]
end
def allowed_page_params
- [:title, :content, thumbnail_attributes: featured_image_params]
+ [:title, :content, { thumbnail_attributes: featured_image_params }]
end
def human_name
@human_name ||= page_collection_name.humanize
end