ruby

ruby’s respond_to? for checking if a method exists

Ruby has a function called respond_to? that can be used to seeing if a particular class or object has a method with a certain name. The syntax is something like

User.respond_to?(’name’) # returns true is method name exists otherwise false

This came in very handy the other day when I wanted to send emails in muziboo […]

Popularity: 42% [?]

Rubyworks on Debian Etch

I recently got a new VPS account and it runs 64 bit Debain Etch (4.0). I installed rubyworks on it and the installation went pretty smooth. After that, I tried to move muziboo.com files to this server and a lot of error started happening in trying to get the app up.
First one was

muziboo@debian:~/muziboo/muz$ rake db:migrate
(in […]

Popularity: 23% [?]

Ruby issues and backgroundrb

Well on a fine saturday morning, i set a breakpoint in my code so that I can read the values of params being passed on a form submit (i wanted to try checkbox arrays) and I get an error saying breakpoints not supported in ruby-1.8.5. I had installed ruby sometime back on my ubuntu […]

Popularity: 14% [?]