delete code, untested

This commit is contained in:
2022-12-11 21:30:25 +02:00
parent fd86f0531c
commit 4a6960efe1
14 changed files with 823 additions and 749 deletions

View File

@ -23,7 +23,7 @@ module Merged
@card.move_down
end
@card.save
redirect_to section_cards_url(@card.section.id),notice: "Card moved"
redirect_to section_cards_url(@card.section.id),notice: "#{@card.header} moved"
end
def new
@ -34,8 +34,7 @@ module Merged
def destroy
@card.destroy
@card.section.save
redirect_to section_cards_url(@card.section.id) , notice: "Card #{@card.index} removed"
redirect_to section_cards_url(@card.section.id) , notice: "#{@card.header} removed"
end
def update
@ -50,7 +49,7 @@ module Merged
@card.set_option(option.name, options[option.name])
end if options
@card.save
redirect_to section_cards_url(@card.section.id) , notice: "Update ok"
redirect_to section_cards_url(@card.section.id) , notice: "Updated #{@card.header}"
end
private

View File

@ -21,7 +21,7 @@ module Merged
end
def destroy
Page.destroy(@page)
@page.destroy()
redirect_to pages_url, notice: "Page #{@page.name} was removed."
end

View File

@ -33,8 +33,7 @@ module Merged
def destroy
@section.destroy()
@section.page.save
redirect_to page_sections_url(@section.page.id) , notice: "Section #{@section.index} removed"
redirect_to page_sections_url(@section.page.id) , notice: "Section #{@section.header} removed"
end
def set_image

View File

@ -3,7 +3,7 @@ module Merged
include MergedHelper
def view
@page = Page.find(params[:id])
@page = Page.find_by_name(params[:id])
end
end