Skip to content

Freelancing Digest

Menu
  • Past Issues
  • Articles
  • About Me
    • Hire Me
    • Contact Me

Redmine Refactor #116: Convert VersionsController to resource

Now that I’ve split the actions in VersionsController, it’s ready to be refactoring to a full RESTful resource. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 # config/routes.rb map.resources :projects, :member => { :copy => [:get, :post], :settings => …

Read more

  • redmine
  • refactoring
  • ruby

Redmine Refactor #115: Split Method in VersionsController

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 …

Read more

  • extract-method
  • redmine
  • refactoring
  • ruby
  • split-method

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 …

Read more

  • extract-method
  • redmine
  • refactoring
  • ruby
  • split-method

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 => …

Read more

  • redmine
  • refactoring
  • ruby

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 …

Read more

  • extract-method
  • redmine
  • refactoring
  • ruby
  • split-method
Posts navigation
Newer posts
Older posts

About Eric | Twitter | Google Plus
Best of Eric Davis | Best of Freelancing | Best of Product Business | Best of Ruby and Rails Programming
Privacy Policy | Terms of Use | A Little Stream Software website

Want to transition from coder to consultant? Learn more: