summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-01 21:14:09 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-01 21:14:09 +0000
commit2967023a0e4d27d5cbea7858b6f5f8b1af38f875 (patch)
tree1ec306067eeaf56998a1af1bec1442ddf5086955 /app/controllers
parent1cb7de5b5a73a5ad97e0ea85677a00c255e11574 (diff)
downloadredmine-2967023a0e4d27d5cbea7858b6f5f8b1af38f875.tar.gz
redmine-2967023a0e4d27d5cbea7858b6f5f8b1af38f875.zip
Resourcified boards.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8020 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/boards_controller.rb23
1 files changed, 17 insertions, 6 deletions
diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb
index 36b0e233c..f9a507e6b 100644
--- a/app/controllers/boards_controller.rb
+++ b/app/controllers/boards_controller.rb
@@ -62,23 +62,34 @@ class BoardsController < ApplicationController
end
end
- verify :method => :post, :only => [ :destroy ], :redirect_to => { :action => :index }
-
def new
- @board = Board.new(params[:board])
- @board.project = @project
- if request.post? && @board.save
+ @board = @project.boards.build(params[:board])
+ end
+
+ verify :method => :post, :only => :create, :redirect_to => { :action => :index }
+ def create
+ @board = @project.boards.build(params[:board])
+ if @board.save
flash[:notice] = l(:notice_successful_create)
redirect_to_settings_in_projects
+ else
+ render :action => 'new'
end
end
def edit
- if request.post? && @board.update_attributes(params[:board])
+ end
+
+ verify :method => :put, :only => :update, :redirect_to => { :action => :index }
+ def update
+ if @board.update_attributes(params[:board])
redirect_to_settings_in_projects
+ else
+ render :action => 'edit'
end
end
+ verify :method => :delete, :only => :destroy, :redirect_to => { :action => :index }
def destroy
@board.destroy
redirect_to_settings_in_projects