From be321798a7d4e1dacf6881f2ba360a0b129781ee Mon Sep 17 00:00:00 2001 From: Benjamin Meichsner Date: Thu, 10 Jun 2010 23:25:13 +0200 Subject: [PATCH] Fixed some links in tasks module. --- app/controllers/tasks_controller.rb | 1 + app/views/tasks/_list.haml | 2 +- app/views/tasks/show.haml | 4 ++-- config/routes.rb | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb index 07a3e505..ee11b6a8 100644 --- a/app/controllers/tasks_controller.rb +++ b/app/controllers/tasks_controller.rb @@ -56,6 +56,7 @@ class TasksController < ApplicationController def destroy Task.find(params[:id]).destroy + flash[:notice] = "Aufgabe wurde gelöscht" redirect_to :action => "index" end diff --git a/app/views/tasks/_list.haml b/app/views/tasks/_list.haml index efb9d617..26369b72 100644 --- a/app/views/tasks/_list.haml +++ b/app/views/tasks/_list.haml @@ -9,7 +9,7 @@ - done = task.done ? " done" : "" %tr{:class => cycle('even','odd', :name => "tasks") + done } %td= format_date(task.due_date) unless task.due_date.nil? - %td= link_to task.name, :controller => "tasks", :action => "show", :id => task + %td= link_to task.name, task_path(task) %td - unless task.users.empty? - owner = Array.new diff --git a/app/views/tasks/show.haml b/app/views/tasks/show.haml index d7291461..0f2194ad 100644 --- a/app/views/tasks/show.haml +++ b/app/views/tasks/show.haml @@ -30,6 +30,6 @@ %p - = link_to "Bearbeiten", :action => "edit", :id => @task + = link_to "Bearbeiten", edit_task_path(@task) | - = link_to "Löschen", {:action => "destroy", :id => @task}, :method => "post", :confirm => "Die Aufgabe wirklich löschen?" + = link_to "Löschen", task_path(@task), :method => :delete, :confirm => "Die Aufgabe wirklich löschen?" diff --git a/config/routes.rb b/config/routes.rb index 72605584..3c70774f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -28,7 +28,7 @@ ActionController::Routing::Routes.draw do |map| # Foodcoop orga map.resources :invites, :only => [:new, :create] map.resources :tasks, - :collection => {:user => :get, :archive => :get} + :collection => {:user => :get, :archive => :get, :workgroup => :get} map.resources :messages, :only => [:index, :show, :new, :create], :member => { :reply => :get, :user => :get, :group => :get } map.namespace :foodcoop do |foodcoop|