delete button neuigkeit

This commit is contained in:
Andreas Stephanides
2013-08-23 18:13:10 +02:00
parent a807922c1d
commit 5f9c7776e8

View File

@@ -10,6 +10,7 @@ class NeuigkeitenController < ApplicationController
@neuigkeit = Neuigkeit.find(params[:id]) @neuigkeit = Neuigkeit.find(params[:id])
if can? :edit, @neuigkeit if can? :edit, @neuigkeit
@toolbar_elements << {:text=>I18n.t('common.edit'),:path=>edit_neuigkeit_path(@neuigkeit),:icon=>:pencil} @toolbar_elements << {:text=>I18n.t('common.edit'),:path=>edit_neuigkeit_path(@neuigkeit),:icon=>:pencil}
@toolbar_elements << {:hicon=>'icon-remove-circle', :text=> I18n.t('common.delete'),:path => neuigkeit_path(@neuigkeit), :method=> :delete,:confirm=>"Sure?" }
end end
end end
@@ -26,7 +27,7 @@ class NeuigkeitenController < ApplicationController
def create def create
@neuigkeit = Neuigkeit.new(params[:neuigkeit]) @neuigkeit = Neuigkeit.new(params[:neuigkeit])
@rubrik = @neuigkeit.rubrik
respond_to do |format| respond_to do |format|
if @neuigkeit.save if @neuigkeit.save