I wrote this:
Sometimes, you have a field on an ActiveRecord Rails model that stores a URL. The user might enter "http://" or they might not. I had this problem, solved it for one model, then needed it for another one. It's plugin baby time!
So I made the world's simplest URL field plugin
Just throw the "url_field" into your class:
class Company url_field :website end @company = Company.new @company.website = "www.example.com" @company.save @company.website #=> "http://www.example.com"
Available now, free on Github