Stubblog


Integrating YUI with Ruby on Rails.
December 19, 2007, 11:54 pm
Filed under: rails, ruby, YUI

Very often, different controllers require different javascript, and while you could just put all your javascript in your application.js file, this doesn’t doesn’t lend itself to anything more than the most basic of applications. It becomes very large, and hard to maintain.

The solution I use is to include any global javascript (prototype etc) in my application.rhtml and then use the controller name to load any specific javascript

<%= javascript_include_tag ‘prototype’ %>
<%= javascript_include_tag “application” %>
<%= javascript_include_tag controller.controller_name %>
Continue reading

Advertisements


I’m starting my new year resolution early.
December 18, 2007, 2:36 pm
Filed under: diet, Getting Things Done, gtd

Anyone who knows me knows that I’m no Kate Moss, I’m no stranger to the words “fat bastard” or “tubby bitch”, even my son told me “you’ve got boobies” once. So with that in mind, it’s about time I started to try and lose the moobs, look a little less like Homer Simpson and shed a few pounds.

I’ve tried in the past, but the most successful weight loss program I had was Christmas 2000 when I had a bad fever and the runs. Not a diet I would recomend, nor one I’d like to try and recreate. My Problem, in all things, is motivation. I spend all day sat on my arse, when I get home from work, I sit in front of the TV or laptop, in short, I’m a lazy turd. The problem is, I LIKE sitting watching TV, I LIKE playing video games or tinkering on the lappy, I need some serious motivation for me to do something else instead.
Continue reading