Resourcified boards.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8020 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2011-12-01 21:14:09 +00:00
parent 1cb7de5b5a
commit 2967023a0e
11 changed files with 87 additions and 57 deletions
+17 -6
View File
@@ -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