FIX: Redirect- und Destroy-Pfad

This commit is contained in:
HausdorffHimself
2013-09-06 20:46:07 +02:00
parent de48cccdbc
commit 30056a0d9f
2 changed files with 4 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ class ThemenController < ApplicationController
def show def show
@thema = Thema.find(params[:id]) @thema = Thema.find(params[:id])
@toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>edit_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=>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| respond_to do |format|
format.html # show.html.erb format.html # show.html.erb
@@ -78,7 +78,7 @@ class ThemenController < ApplicationController
@thema.destroy @thema.destroy
respond_to do |format| respond_to do |format|
format.html { redirect_to themen_url } format.html { redirect_to themengruppe_path(@thema.themengruppe) }
format.json { head :no_content } format.json { head :no_content }
end end
end end

View File

@@ -23,10 +23,9 @@
</div> </div>
</br> </br>
<% unless @thema.id.nil? %>
<% @att_elements = [{:icon=>:plus, :hicon=>'icon-plus', :text=>I18n.t('attachment.add'), :path=>new_thema_attachment_path(@thema)}] %> <% @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 %> <%= render :partial=>'layouts/pretty_toolbar', :object=>@att_elements %>
<!-- <% end %>
<%= link_to 'Neues Attachment', new_thema_attachment_path(@thema) %>
-->
<br/> <br/>