Make stuff sortable
This commit is contained in:
parent
50e853098b
commit
ee5dbcf33e
21 changed files with 161 additions and 28 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue