on Sunday, September 4, 2011
I've started a simple Rails 3 + authlogic example project on github, mostly for myself to experiment with. Right now it's basically a copy of this post's implementation (and unfinished at that), but I'll be expanding it over the next few days in various ways.

As it stands, the "application" (I use the term loosely) consists of a home page (root path) requiring login, and login/logout actions.
on Sunday, August 28, 2011
(Not checkboxes, in my case, but a checkbox example is easy, and more common.)

Originally I thought I needed accepts_nested_attributes_for, but that seems to be mostly for when we're creating the related objects, which I'm not--I need to save relationships to existing objects.

My example (github) uses a simple product/category relationship. We need to get a product's categories, we need to get
on Monday, August 22, 2011
Throwing this out there to see what people thing--I suspect there are better, cleaner ways to do this, and I'm wondering what they are.
$.fn.click1 = function(fn) {
$(this).data('clicked', false);
$(this).click(function(o) {
if ($(this).data('clicked')) return false;
$(this).data('clicked', true);
fn(o);
return false;
});
};

(I return false because I know I don't
on Tuesday, August 9, 2011
I'm trying to figure out the "best" way to support discovery of custom validator errors on a Rails 3 model.

My model has both standard and custom validators. I need to check for validation errors from the custom validators, in both controller and template.

My slap-dash solution was to add an additional error message keyed to the field name suffixed with a validator-specific extension. For
on Monday, August 8, 2011
I push the command line on people, because it's generally the most efficient way to do several different things. My devs resist me, although I don't understand why... part of it is that most places I've worked at are Windows houses. No problem, say I: Cygwin to the rescue. Seriously, gang, I'm not just making this up.

(I'll grant, however, that there are some Finder/Explorer replacements that
on Friday, August 5, 2011
Two FB apps, both using FB.ui to publish to a stream. One worked, one didn't, nobody knew why. I needed to know.Nutshell: FB JS code was inadvertently included twice (not by me, which always makes things more difficult). This caused the app_id and app_key values in the FB.ui call to go away--everything else was there, but two pieces critical (obviously) weren't. Note that the app code didn't
on Friday, July 1, 2011

Several sites describe the process necessary to get TextMate to use either a wrapped (via the rvm wrapper command) or an rvm-specified default Ruby interpreter (including gemsets, basically anything you can use with the rvm use command).


Following just those steps never worked for me, even when I explicitly gave a wrapped TM_RUBY: it would still do an exec ruby in there and blow up. I've