Skip to content

Instantly share code, notes, and snippets.

View webdevbyjoss's full-sized avatar

Joe Chereshnovsky webdevbyjoss

View GitHub Profile
webdevbyjoss / gist:4045634
Created November 9, 2012 13:19
Render error messages of Backbone.Validation for Twitter Bootstrap
// Original CoffeScript gist can be found here: (credits to the author)
// I just translated it to JavaScript for my own needs using Coffeescript to Javascript translator
_.extend(Backbone.Validation.callbacks, {
valid: function(view, attr, selector) {
var control, group;
control = view.$('[' + selector + '=' + attr + ']');
group = control.parents(".control-group");
if ("error-style") === "tooltip") {