]> source.dussan.org Git - redmine.git/commitdiff
Refactor: Extract method
authorEric Davis <edavis@littlestreamsoftware.com>
Thu, 4 Mar 2010 05:33:35 +0000 (05:33 +0000)
committerEric Davis <edavis@littlestreamsoftware.com>
Thu, 4 Mar 2010 05:33:35 +0000 (05:33 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3534 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/boards_controller.rb

index 436398d1c392758bd7f88cf2acd931e2f0f97ef6..843d0e27ca53b39ed25847a450590be2526c9cfa 100644 (file)
@@ -68,22 +68,26 @@ class BoardsController < ApplicationController
     @board.project = @project
     if request.post? && @board.save
       flash[:notice] = l(:notice_successful_create)
-      redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'boards'
+      redirect_to_settings_in_projects
     end
   end
 
   def edit
     if request.post? && @board.update_attributes(params[:board])
-      redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'boards'
+      redirect_to_settings_in_projects
     end
   end
 
   def destroy
     @board.destroy
-    redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'boards'
+    redirect_to_settings_in_projects
   end
   
 private
+  def redirect_to_settings_in_projects
+    redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'boards'
+  end
+
   def find_project
     @project = Project.find(params[:project_id])
     @board = @project.boards.find(params[:id]) if params[:id]