Still focusing on the VersionsController, I need to split another method before I can refactor this controller’s routing. This time #new needs to be split into #new and #create. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 …
Tag: refactoring
Redmine Refactor #114: Split Method in VersionsController
Just like in FilesController, I need to split a few methods in VersionsController before I can nest it under the projects resource. Before 1 2 3 4 5 class VersionsController 'projects', :action => 'settings', :tab => 'versions', :id => @project end end end endclass VersionsController 'projects', :action => 'settings', :tab => 'versions', :id => @project …
Redmine Refactor #113: Convert FilesController to resource
With yesterday’s split method on FilesController complete, I’m now ready to convert FilesController to become a full RESTful resource under projects. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 # config/routes.rb map.resources :projects, :member => { :copy => …
Refactoring Redmine, the ebook launched
Today is a great day for me; I’m finally launching Refactoring Redmine. Refactoring Redmine is an ebook of 82 real world Ruby on Rails refactorings that I’ve done to Redmine. If you’re a reader of this blog, you have probably seen some of my refactoring over the past year. If you ever had trouble learning …
Redmine Refactor #112: Split Method in FilesController
The next step to refactor Redmine’s ProjectsController is to start converting all of it’s related resources into RESTful controllers. Looking at config/routes.rb, it looks like FilesController is using three custom routes that hang off of ‘/projects/’ and the #new action is being used for both HTTP GET and HTTP POST. So I’ll use split method …