summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-22 21:32:45 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-22 21:32:45 +0000
commit6577f37fc3c332a6d5e5a50f6d30820b93143436 (patch)
treee7d46f134350b1d7a63f2a1f326779bedd2fb818 /app/controllers
parent33f7f5a00d2a0519935182956da4f64aa69acba7 (diff)
downloadredmine-6577f37fc3c332a6d5e5a50f6d30820b93143436.tar.gz
redmine-6577f37fc3c332a6d5e5a50f6d30820b93143436.zip
Resourcified trackers.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7888 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/trackers_controller.rb23
1 files changed, 17 insertions, 6 deletions
diff --git a/app/controllers/trackers_controller.rb b/app/controllers/trackers_controller.rb
index 2f827af2e..1a7022f37 100644
--- a/app/controllers/trackers_controller.rb
+++ b/app/controllers/trackers_controller.rb
@@ -22,8 +22,6 @@ class TrackersController < ApplicationController
before_filter :require_admin_or_api_request, :only => :index
accept_api_auth :index
- verify :method => :post, :only => :destroy, :redirect_to => { :action => :index }
-
def index
respond_to do |format|
format.html {
@@ -37,6 +35,12 @@ class TrackersController < ApplicationController
end
def new
+ @tracker ||= Tracker.new(params[:tracker])
+ @trackers = Tracker.find :all, :order => 'position'
+ @projects = Project.find(:all)
+ end
+
+ def create
@tracker = Tracker.new(params[:tracker])
if request.post? and @tracker.save
# workflow copy
@@ -47,20 +51,27 @@ class TrackersController < ApplicationController
redirect_to :action => 'index'
return
end
- @trackers = Tracker.find :all, :order => 'position'
- @projects = Project.find(:all)
+ new
+ render :action => 'new'
end
def edit
+ @tracker ||= Tracker.find(params[:id])
+ @projects = Project.find(:all)
+ end
+
+ def update
@tracker = Tracker.find(params[:id])
- if request.post? and @tracker.update_attributes(params[:tracker])
+ if request.put? and @tracker.update_attributes(params[:tracker])
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'index'
return
end
- @projects = Project.find(:all)
+ edit
+ render :action => 'edit'
end
+ verify :method => :delete, :only => :destroy, :redirect_to => { :action => :index }
def destroy
@tracker = Tracker.find(params[:id])
unless @tracker.issues.empty?