Archive for November, 2008

Cache Template Extensions Error

Saturday, November 29th, 2008

If you’re getting:

  undefined method `cache_template_extensions=' for ActionView::Base:Class (NoMethodError)

You have a line in config/environments/development.rb and config/environments/production.rb that calls a deprecated method cachetemplateextensions=. You need to remove this line in order to get your application to function properly. This is usually line #13 in both files.

21st Birthday

Monday, November 24th, 2008

I’m going to be having a party at the Tap Inn starting @ 6:30pm @ The Tap Inn on the 4th December. Those wishing to come please contact me using the usual means.

Catch-All SEO-Friendly URLs

Monday, November 24th, 2008

This tutorial was written using Ruby 1.8.6, Rails 2.2.2 and Rubygems 1.3.1.

This question has been coming up a lot recently. People want urls like http://domain.com/frozenplague-rules-my-world but they don’t know how to do it.

Let’s say you have a model called Blog and this is what you want to match to http://domain.com/frozenplague-rules-my-world. In this model you define:

app/models/blog.rb

def to_param
  "#{id}-#{title.parameterize}"
end

And then this in your config/routes.rb

map.connect ':slug', :controller => "blogs", :action => "show"

And now you should be able to access blogs through http://domain.com/frozenplague-rules-my-world.

Adelaide – 2 Degrees of Separation

Sunday, November 23rd, 2008

One thing that apparently struck a lot of people when they came to Adelaide for Railscamp last weekend was how small Adelaide actually is. Over the course of a few months there’s been a few instances where I’ve known people I’ve spoken with through a very small degree of separation. The three instances that I’ve encountered this year are:

  • The guy I hit with my car has a friend who’s dad works with my dad
  • Yesterday had a barbecue @ James’s house and met up with somebody who uses the Netfox product
  • At the barbecue also met up with a girl who hangs out with an old childhood friend of mine who I haven’t seen in years

It amazes me how we’re all interconnected somehow.

Railscamp #4

Monday, November 17th, 2008

If somebody had told me that 6 months ago on this day I would be cleaning toilets I would’ve laughed at them. But, that’s how Railscamp #4 ended, just me and the SeaLink guys (Adam, Anuj & Vishal) cleaning the Bunk House.

Some Information

There’s a lot that goes into running an event like this. It started shortly after Railscamp #3 when discussion was going on in #roro about the next event and somehow the onus was put on us Adelaidians to hold an event in the coming months. We thought about choosing a sea-side venue for a start, but the ones I contacted were too expensive. Anthony Richardson (hereafter referred to as Richo) suggested Woodhouse and that was seconded by a friend of mine and so we explored the venue and I fell in love. The prices and dates and size and … everything was fabulous. Booked that in right away and paid the deposit. Cost was $20 per head in a bunk, $10 per camper.

The catering was dealt with by Anthony (but recommended by the venue’s website) which was fantastic. $50 per head for that wide of a choice of food was just marvelous.

For the projector screens we went with a company called Hire Intelligence. $75 per screen.

For the projectors Dr Nic brought his and so did anathematic (Thomas Sinclair)

Extra chairs + tables were hired from Atlas Party Hire. 25 chairs + 5 tables was $219.95.

Attendees were hired from the Ruby on Rails community, but can usually be found anywhere near sources of electricity and alcohol.

I’d like to thank…

Although I was the one who put the deposit down on the venue, there’s people who did way more than me.

Firstly, thanks to Richo for everything (yes, even yelling at me on Friday night), you’ve opened my eyes to a whole new world of “let someone else do it”. Also thanks for the pancakes and just generally being there to help run things.

Secondly, on Sunday morning there was one person out of the whole seven who were up who helped me do the dishes and that was Pythonic (Nick Jefferson). Thanks man, was feeling a bit overwhelmed at the time.

Thirdly, thanks to those of you (all of you!) who just cleaned up general. Nothing worse than trying to code surrounded by mess. Also those of you who were still cleaning up after the bus left.

Thanks to Lincoln Stoll for all his work setting up the servers / network.

Thanks to the caterers for absolutely kicking ass on the cooking duties. Beautiful work ladies, well worth the money.

Thanks to Pat Allan for coming and sharing his Sphinx wisdom and holy presence with us, and especially for the Werewolf deck and moderating a couple of games. On a similar line, thanks to Myles for narrating a few games whilst under the influence of “just a couple” of drinks.

Thanks to Lachie for his manipulation of twitter messages. Now, if only the real Twitter did something like that for April Fools.

Thanks to whoever it was who left the Monopoly board out. I think I missed out on a few excellent presentations (judging by the applause) whilst I got my ass handed to me by Tom.

Thanks to those of you who did presentations and got heckled by Dr. Nic.

Thanks to Pete Yandell for making (not during railscamp, but before) and presenting Machinist, what appears to be an excellent replacement for fixtures.

Thanks to those who left iChat open and therefore allowed me to troll their presentations, especially Brenton Fletcher. Thanks to the Apple iPhone team who put Crickets as a ringtone for the iPhone as well and Rick Astley for his song of joy and love.

Thanks to chendo for writing cryptoquote, a word game where you get a quote that is encrypted, for example e = w and d = f and so on and you have to say stuff like e=w in a chat-like text box which will reveal your answer to be correct and give you points. It has a lot of promise to be a great procrastination tool for a lot of people.

And the best for last, all the attendees who were there for one, two, three or all four days. Without you guys there would be no Railscamp and no awesome Australian Rails community. You guys are the greatest people I know.

Railscamp

Thursday, November 13th, 2008

Railscamp is tomorrow!

Everything seems to be arranged, just gotta get the people there and then we can rock on.

Looking forward to it.

Lost in Translation

Wednesday, November 5th, 2008

On my pet project rBoard I’ve been adding in t calls every where just in case someone wants to use it and translate it into their own language, and I got petrified of missing a translation somewhere along the lines so tonight (with a little help from #rubyonrails) I made a little rake task to check for you:

Stick this in a file in lib/tasks and run it by typing rake missing_translations and you’ll be told what’s missing from what file and from what locale and you’ll even be given a nice counter that you can watch slowly decrement every time you fix a missing translation!

Dear India

Wednesday, November 5th, 2008

I grow weary of you undercutting us honest workers in the web design industry and sending people who obviously do not know how to speak the English language into a primarily english based programming language. Perhaps, if you taught them how to speak the language the code is written in, then perhaps I would not be writing this blog post. I am not intending to be racist, but if it comes across that way I don’t really care. I worked with two people from different regions of India for near-on 8 months and they were two of the smartest (and greatest) people I have ever met.

Your slaves workers come into #rubyonrails and ask in their distorted english extremely vague questions and expect us to help them with little or no clue as to what they’re trying to do. Then when you ask them, it takes them forever to respond because they have to translate from their language, to ours. It is annoying and frankly I am no longer willing to put up with it. From now on anybody from India asking a question in #rubyonrails will be promptly placed on my ignore list unless they simply: 1) Ask in clear, concise English 2) Explain what their problem is rather than going “can any1 hlp me plz????”

What I am asking here is that before throwing them into the deep end of a programming language, teach them how to speak English (and not that shorthand crap either) and how to be polite and courteous and grateful for the free help we hand out on a daily basis in #rubyonrails. That’s all, no strings attached. Simple.

Love, Radar