Monthly Archives: June 2011

Debugging Cucumber Tests With Ruby-Debug

Today I ran into a scenario where I needed to step through some ruby code and examine the state of various objects in my rails app. I’ve used the ruby-debug gem a number of times to do exactly this. However, … Continue reading 

Posted in Cucumber, Debugging, Ruby | 7 Comments

Welcome, Hugo Bonacci, To LosTechies!

Not quite a year ago, I interviewed a developer while working at my previous job. He struck me, my boss, and the other people that interviewed him, as some one who is passionate about and dedicated to building great software … Continue reading 

Posted in Community | 1 Comment

Rendering A Rails Partial As A jQuery Template

A question was asked on twitter: Here’s one of the answers that I sent to rob, in the form of a gist: I’m using this solution in my current rails app and it’s a very elegant way to use an … Continue reading 

Posted in Javascript, JQuery, Rails | 4 Comments

Rendering jQuery Templates With Backbone Views

In my previous examples of using views with Backbone.js, I showed a simple login form that was built directly in to the page’s html markup. In a more complex app, you are likely going to load content from a server … Continue reading 

Posted in Backbone, Javascript, JQuery, JSON, Model-View-Controller | 18 Comments

Making Mongoid Play Nice With Backbone.js

Backbone has some great features that make it dirt-simple to integrate with a Rails back end. For example, the Backbone models have a .fetch(), .save() and .destroy() method on them. These methods make a call back to your server, based … Continue reading 

Posted in Backbone, Javascript, JSON, MongoDB, Mongoid, Rails, Ruby | 11 Comments

Solving Backbone’s “this.model.view” Problem With Underscore.js

In my last post, I briefly touched on a small problem in the relationship between the view and the model. Here’s the relevant code, again:   This is some awful code, honestly. I didn’t like it when I first wrote … Continue reading 

Posted in Backbone, Javascript, JQuery, Model-View-Controller | 11 Comments

Binding A Backbone View To A Model, To Enable and Disable A Button

Continuing the contrived example from yesterday – a very simple login form – I wanted to show how Joey and I are using backbone’s events and models to enable and disable a button on the form.   The Form Layout … Continue reading 

Posted in Backbone, Javascript, Model-View-Controller, Principles and Patterns | 15 Comments

Intro To Backbone.js: How A Winforms Developer is At Home In Javascript

Today, I was introduced to Backbone.js and I almost immediately fell in love with it. It’s powerful. It’s elegant. But most of all, it’s a set of design and interaction patterns that I have a lot of experience using.   … Continue reading 

Posted in Backbone, Design Patterns, Javascript, JQuery, Model-View-Controller, Model-View-Presenter | 25 Comments

Partially Solving The Date Validation Deficiency Of Rails 3 And Mongoid 2 Models

A while back, I posted a question on stack overflow on how to properly validate a date input from a text field input, without throwing exceptions when the string provided is not a valid date.  The core of the problem … Continue reading 

Posted in Mongoid, Rails, Ruby | Leave a comment

Using ActiveSupport::Notifications and ActiveSupport::Concern To Create An Audit Trail

In my previous post, I outlined a scenario that needs to be audited for HIPAA compliance – a patient with a list of medications. Every time a medication is added, updated or deleted, an audit record has to be created … Continue reading 

Posted in Analysis and Design, Logs, Rails, Ruby | 2 Comments