April 2009
38 posts
What’s the best thing you could be working on, and why aren’t you?
– Good and Bad Procrastination
error_message_on and nested model forms
When an object has_many of another. For example a User has_many Hats, you use error_message_on as such when validation on the size fails.
error_message_on :user, :hats_size
centos 5.3 + ruby 1.8.6 = failing hpricot
I couldn’t get the hpricot gem to build with my CentOS 5.3 + Ruby 1.8.6 build. Turns out I had to uninstall all the 1.8.5 ruby packages I had installed with yum to get it to work.
zip()
Given an array [1,2,3] and [“A”,”B”,”C”], I wanted the result [[1,”A”],[2,”B”],[3,”C”]]
>> a,b = [1,2,3], ["A","B","C"]
=> [[1, 2, 3], ["A", "B", "C"]]
>> a
=> [1, 2, 3]
>> b
=> ["A", "B", "C"]
>> a.zip(b)
=> [[1, "A"], [2, "B"], [3, "C"]]
Transpose also achieves the same thing.
>>...
Think of how stupid the average person is, and realize half of them are stupider...
– George Carlin
If you simply show up and take what life offers, yeah, you might be able to...
– A Beginner’s Guide to Carb Cycling
Users write “moar” to challenge each other to post further loathsome...
– Fox News discovers 4chan
If you are not prepared to lose, you probably won’t win.
– Dealing with impossible crises