Permalink
Browse files

More Coffeescript goodness

  • Loading branch information...
bcardarella committed Jan 24, 2012
1 parent e066595 commit 0b2243a386ff0ffd546c75902cfab5a7da522b9e
@@ -15,11 +15,11 @@ ClientSideValidations.formBuilders['Formtastic::FormBuilder'] =
wrapper.addClass('error')
wrapper.append(errorElement)
else
- element.parent().find('p.' + settings.inline_error_class).text(message)
+ element.parent().find("p.#{settings.inline_error_class}").text(message)
remove: (element, settings) ->
wrapper = element.closest('li.error')
- errorElement = wrapper.find('p.' + settings.inline_error_class)
+ errorElement = wrapper.find("p.#{settings.inline_error_class}")
wrapper.removeClass('error')
errorElement.remove()
@@ -22,13 +22,13 @@
wrapper.addClass('error');
return wrapper.append(errorElement);
} else {
- return element.parent().find('p.' + settings.inline_error_class).text(message);
+ return element.parent().find("p." + settings.inline_error_class).text(message);
}
},
remove: function(element, settings) {
var errorElement, wrapper;
wrapper = element.closest('li.error');
- errorElement = wrapper.find('p.' + settings.inline_error_class);
+ errorElement = wrapper.find("p." + settings.inline_error_class);
wrapper.removeClass('error');
return errorElement.remove();
}

0 comments on commit 0b2243a

Please sign in to comment.