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 …
Tag: split-method
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 …
Daily Refactor #34: Split Methods in the controllers
Back after a short personal break, I’m going to start on another set of refactorings in Redmine to remove some more duplication. The Refactoring This time I used split method to separate two behaviors in six similar before_filters. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 # app/controller/issue_relations_controller.rb class …