“Imagine for a moment that someone has established for you a very unusual bank account. Each morning he has agreed to deposit $86,400. At then at the end of each day whatever you have not spent will be forfeited. Would you not be diligent to see to it that every penny of that account was withdrawn and properly spent? Would you allow any of it to expire unredeemed? You have such an account. For God has given you 86,400 precious and irreplaceable seconds in this day. Whatever is not used will expire and can never be reclaimed. Seize each moment therefore and invest it wisely.” — Rick Grubbs
Author: Matthew
-
Fix for Streamlined menu rendering in Rails 2
I noticed an interesting side effect of the default behavior of Rails today. A fresh Rails 2.0.2 app includes a line in
app/controllers/application.rbthat looks like this:helper :all # include all helpers, all the time
It looks innocuous enough, but this line can actually cause some unexpected behavior when overriding Streamlined’s
streamlined_top_menuandstreamlined_side_menuhelper methods on a controller-by-controller basis.I had two Streamlined controllers setup, one for users and one for roles. I defined the users side menu and the roles side menu to each have certain links, like so:
# users_helper.rb def streamlined_side_menu # stuff here end # roles_helper.rb def streamlined_side_menu # different stuff here end
When I visited the users controller, I saw the menu contents for the users controller. When I visited the roles controller, however, I saw the menu contents for… the users controller. What was happening was that ALL the helpers were being loaded for each controller, which meant that the
streamlined_side_menumethod defined in the roles helper got overridden by the users helper since the users helper was loaded after the roles helper.Removing
helper: allfixed the problem for me. -
And you thought homeschooling was tough?
These people need to seriously rethink their approach to preschool. Why not just teach the kid at home for a year instead of freezing your tail off in line?
-
Growth in Ruby jobs relative to Java
This is one of the reasons I’m doing mostly Rails consulting right now.
-
Trouble purchasing iPod Touch January update
I was initially quite irritated with Apple for choosing to charge existing iPod Touch users like myself a $20 bill to get a hold of their January update. I’m still a bit ticked since it seems quite unfair to punish the early adopters like this, but by last Tuesday I had decided to push past my annoyance and plunk down the $20 for the update.
Now I can’t seem to purchase it for some reason.
When I visit the iTunes store or Apple’s web site and click on the link to buy the update, I get sent to a page with information about the update and a single OK button. I click OK and get sent back to the iTunes store home page. Every. Single. Time.
I’ve called Apple a couple of times on this. They say it’s a bug on their end and that they’re working on it, but they can’t seem to give me an estimated resolution time. Apparently, this problem is only being experienced by a few lucky people, like myself.
Has Apple lost a sale? Possibly. I want to give them my $20, but they just don’t seem to want it that badly. I may opt to use the 1.1.3 jailbreak instead (when it becomes available for the Touch).
And I was really looking forward to using the “official” apps…
-
Quote of the Week: George Orwell
“Whoever controls the image and information of the past determines what and how future generations will think; whoever controls the information and images of the present determines how those same people will view the past.” — George Orwell
-
Locking a nation into permanent childhood
America’s education system is majorly messed up. The disturbing thing is the intentionality with which it’s being destroyed, coupled with the ignorance of most parents to what’s really going on:
… American schooling was taken over, in the late 19th century, by statists enamored of the Prussian compulsion model, aiming to create a docile peasant class by crippling the American intellect — making reading seem real hard, for starters, by replacing the old system in which delighted kids learned to combine the sounds of the Roman letters, with a perverted “whole word” method better suited to decoding hieroglyphics.
If God blesses me with a family, I’ll be homeschooling my kids. I only hope it’s still legal by that time.
-
Default methods fixed in fixture_replacement2
The problem I recently blogged about has been fixed in fixture_replacement2. Thanks, guys!
-
Layout assertion added to test_spec_on_rails
After contacting Rick with my patch, he offered to give me commit access to the project. I took him up on the offer, so the layout assertion is now in there.
test_spec_on_rails is now on Git so unless you’re running Edge Rails you can’t use script/install to grab it. My suggestion is to clone from Git into vendor/plugins and then svn:ignore the .git file:
git clone git://github.com/pelargir/test_spec_on_rails.git vendor/plugins/test_spec_on_rails svn propset svn:ignore .git vendor/plugins/test_spec_on_rails
-
Fixed bid vs. time and materials
“It’s unwise to pay too much… but it’s worse to pay too little. When you pay too much, you lose a little money… that is all. When you pay too little, you sometimes lose everything, because the thing you bought was incapable of doing the thing it was bought to do. The common law of business balance prohibits paying a little and getting a lot…it can’t be done. If you deal with the lowest bidder it is well to add something for the risk you gain. And if you do that, you will have enough to pay for something better.” — John Ruskin 1819-1890