moving sections up and down

This commit is contained in:
2022-12-01 20:14:34 +02:00
parent a4af2d6872
commit 4f6538e135
8 changed files with 51 additions and 40 deletions

View File

@ -38,6 +38,16 @@ module Merged
redirect_to section_url(@section.id)
end
def move
if( params[:dir] == "up")
@section.move_up
else
@section.move_down
end
@section.save
redirect_to page_sections_url(@section.page.name)
end
def update
@section.content.each do |key , value|
next if key == "id"