The squirrels are blogging


posted in Ruby, 01.02.10 12:08


Speed up Mongrel / RubyOnRails development

This is great! With the Talentsuche.de RubyOnRails app growing the mongrel development server was getting slow and slower. Lately a request took up to 3000ms - that's unusable for front end development.

But there is quick way to speed this up. Mongrels default behaviour is to listen on all interfaces/addresses (0.0.0.0). By setting a single ip you can make it a lot faster.

 ./script/server -b 10.23.23.23 -p 3000

posted in Ruby, 05.09.09 14:50


Custom mime types in Rails

To register a custom mime type in Rails, call the register method from your controller:
Mime::Type.register "image/jpeg", :jpg
Your mime type can be used in the respond_to block now:
format.jpg do 
  #do something
end

posted in Ruby, 21.08.09 23:50


String#gsub and unicode chars

It's a really dirty hack. But String#split supports unicode by default, while String#gsub gets confused. However: the problem is fixed in 1.9.