thema verwalten added

This commit is contained in:
Andreas Stephanides
2014-03-29 12:43:08 +01:00
parent a8401391a6
commit 07f53c59bc
8 changed files with 53 additions and 38 deletions

View File

@@ -16,16 +16,27 @@ class ThemenController < ApplicationController
# GET /themen/1.json
def show
@thema = Thema.find(params[:id])
redirect_to :controller=>'themengruppen', :id=>@thema.themengruppe.id, :action=>:show, :anchor=> params[:id].to_s
@fragen=@thema.fragen
@toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>"Verwalten", :path=>verwalten_thema_path(@thema)}]
@toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>edit_thema_path(@thema)}]
@toolbar_elements << {:hicon=>'icon-remove-circle', :text=>I18n.t('thema.remove'), :path=>thema_path(@thema), :method=>:delete, :confirm=>I18n.t('thema.sure')}
respond_to do |format|
format.html # show.html.erb
format.json { render json: @thema }
end
# respond_to do |format|
# format.html # show.html.erb
# format.json { render json: @thema }
# end
end
def verwalten
@thema = Thema.find(params[:id])
@fragen=@thema.fragen
@toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>"Verwalten", :path=>verwalten_thema_path(@thema)}]
@toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>edit_thema_path(@thema)}]
@toolbar_elements << {:hicon=>'icon-remove-circle', :text=>I18n.t('thema.remove'), :path=>thema_path(@thema), :method=>:delete, :confirm=>I18n.t('thema.sure')}
end
# GET /themen/new
# GET /themen/new.json
def new