From 30056a0d9f15653b0bd16c54e7cf61aa195e6f99 Mon Sep 17 00:00:00 2001 From: HausdorffHimself Date: Fri, 6 Sep 2013 20:46:07 +0200 Subject: [PATCH] FIX: Redirect- und Destroy-Pfad --- app/controllers/themen_controller.rb | 4 ++-- app/views/themen/_select.html.erb | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/controllers/themen_controller.rb b/app/controllers/themen_controller.rb index d9b1399..f024c79 100644 --- a/app/controllers/themen_controller.rb +++ b/app/controllers/themen_controller.rb @@ -15,7 +15,7 @@ class ThemenController < ApplicationController def show @thema = Thema.find(params[:id]) @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=>themengruppe_thema_path(@thema), :method=>:delete, :confirm=>I18n.t('thema.sure')} + @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 @@ -78,7 +78,7 @@ class ThemenController < ApplicationController @thema.destroy respond_to do |format| - format.html { redirect_to themen_url } + format.html { redirect_to themengruppe_path(@thema.themengruppe) } format.json { head :no_content } end end diff --git a/app/views/themen/_select.html.erb b/app/views/themen/_select.html.erb index c7b02fd..fb91bcb 100644 --- a/app/views/themen/_select.html.erb +++ b/app/views/themen/_select.html.erb @@ -23,10 +23,9 @@
+<% unless @thema.id.nil? %> <% @att_elements = [{:icon=>:plus, :hicon=>'icon-plus', :text=>I18n.t('attachment.add'), :path=>new_thema_attachment_path(@thema)}] %> <%= render :partial=>'layouts/pretty_toolbar', :object=>@att_elements %> - +<% end %>