neuigeiten startseite

This commit is contained in:
Andreas Stephanides
2013-08-23 18:28:38 +02:00
parent 5f9c7776e8
commit d928330189
4 changed files with 14 additions and 7 deletions

View File

@@ -11,6 +11,8 @@ class NeuigkeitenController < ApplicationController
if can? :edit, @neuigkeit
@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?" }
@toolbar_elements << {:hicon=>'icon-plus', :text=> "publish",:path => neuigkeit_publish_path(@neuigkeit),:confirm=>"Sure?" }
end
end
@@ -20,7 +22,12 @@ class NeuigkeitenController < ApplicationController
@neuigkeit.rubrik=@rubrik unless @rubrik.nil?
end
def publish
@neuigkeit = Neuigkeit.find(params[:id])
@neuigkeit.publish
@neuigkeit.save
redirect_to @neuigkeit
end
def edit
@neuigkeit = Neuigkeit.find(params[:id])
end