Make stuff sortable

This commit is contained in:
david 2024-11-11 04:04:13 +01:00
parent 50e853098b
commit ee5dbcf33e
21 changed files with 161 additions and 28 deletions

View file

@ -49,7 +49,12 @@ class ElementsController < ApplicationController
# PATCH/PUT /elements/1
def update
if @element.update(element_params)
redirect_to @element, notice: "Element was successfully updated.", status: :see_other
respond_to do |format|
format.turbo_stream
format.html do
redirect_to @element, notice: "Element was successfully updated.", status: :see_other
end
end
else
render :edit, status: :unprocessable_entity
end
@ -82,6 +87,6 @@ class ElementsController < ApplicationController
# Only allow a list of trusted parameters through.
def element_params
params.require(:element).permit(:page_id, :title, :description)
params.require(:element).permit(:page_id, :title, :description, :position)
end
end