Posted on December 2, 2007 by awmanoj
If efficiency is important to you, don’t build a new string when you can append items onto an existing string. Constructs like str << ‘a’ + ‘b’ orĀ str << “#{var1} #{var2}” create new strings that are immediately subsumed into the larger string. This is exactly the thing to avoid. Use str << var1 << [...]
Filed under: Ruby | Tagged: Advice, Ruby, Strings | Leave a Comment »
Posted on December 2, 2007 by awmanoj
I’ll be starting with Ruby Cookbook today (it’s evening right now..). I will be discussing Ruby code, Constructs, Positives and Negatives as I encounter them. So expect lot of Ruby (and may be rails) here.
Association with the language: Why I fell in Love with Ruby
Filed under: Ruby | Tagged: Ruby, Study | Leave a Comment »
Posted on November 6, 2006 by awmanoj
I got stuck for last half an hour at ‘getting the values of multiple selected items in a muliple selection box’ using Ruby/Rails. Got it after hard ‘googling’ and got the solution here.
When trying to get multiple selected values from a <SELECT> tag into @params, call your parameter something with [] on the end. [...]
Filed under: Programming, Rails, Ruby, technical | 3 Comments »
Posted on October 26, 2006 by awmanoj
There is a very common requirement especially in web services, that of sending notification email for some action say, addition/deletion/updation of database in user signup or product selection in a shopping cart. Ruby handles it beautifully. This is obvious. What is not obvious is that it actually gives user different ways of implementing it.
RubyMail
TMail
ActionMailer (uses [...]
Filed under: Rails, Ruby, technical | Leave a Comment »