Rails developer best friends

September 21st, 2009
As you may already know (but, frankly, I don't see how) a month ago I've changed my job. Yes, I'm not any more employee of Netage.bg and I'm not any more full time PHP developer. In fact now I'm not even a part time PHP developer.

Currently I'm involved in a project named MeetPips.com which is part of group of sites, all related to Forex market.

Although I'm in the Rails hype since 2006 or something this is my first full time Rails job and even more - it's a telecommute job, so let me share some of the tools that makes the life of a Rails developer happier.

Vim - that was may be the biggest change for me. During the years I was playing with all Rails related IDEs - as an Eclipse user I first tried Aptana, then switched to NetBeans and finally I was playing with RubyMine. All these are not bad IDEs, but there was always something that I didn't liked, meanwhile I was always frustrated when trying to switch to Vim with all these plugins, mappings and the other .vimrc magic. One day I found http://github.com/jferris/config_files and everything came to its place.

RSpec and Cucumber - Both specs and features are in great help when you have to jump in new and unknown code base - if you don't know what's this or what is it doing - read the specs. If there are not any - write some.

Git - the better version control system. Especially if you are working telecommute and your co-workers are all over the world. And of course GitHub.

rdebug - helps you see what's going on inside your code.

Hoptoad - users are known to be the best bug finders, but not many of them report these bug. Hoptoad will do this for you.

Engine Yard Solo - Rails hosting without pain.

NewRelic - application performance monitoring.

That's all, folks.
0 comments »



Rails Underground, London, July 24-25 2009

July 22nd, 2009
I'm attending Rails Underground!
0 comments »



How to generate urls for ActionMailer emails

November 13th, 2007
This is a little bit tricky, but I've found an solution in the comments from other article on this problem. First we need to set default_url_options for ActionMailer::Base. This can be done with before_filter method in ApplicationController

1
2
3
4
5
6
7
8
class ApplicationController < ActionController::Base
  before_filter :set_default_url_options_for_mailers

  def set_default_url_options_for_mailers
    ActionMailer::Base.default_url_options[:host] = request.host_with_port
  end

end
Now we can generate the url in the mailer model
1
2
3
4
5
6
7
8
9
  def email_confirmation(user)
    recipients user.email
    from  "example.com  <no-reply@example.com>"
    subject "Confirm your email address"
    content_type "text/html"

    body :user => user, :activation_page => url_for(:controller => "main", :action => 
    'activate', :only_path => false)
  end

1 comment »