Anton Shestakov <av6@dwimlabs.net>, Tue, 22 Mar 2016 15:05:34 +0800
rivets: more idiomatic first-letter formatter
coffee/validation.coffee
Permissions: -rw-r--r--
setError: ($field, message) -> $el = $('<div class="uk-text-danger"></div>').text(message) $field.addClass('uk-form-danger') $field.removeClass('uk-form-danger').siblings('.uk-text-danger').remove() validateRequired: (field, trim) -> @setError $field, 'This field is required.' validatePasswords: (field1, field2) -> if $field1.val() isnt $field2.val() @setError $field2, 'Passwords must match.'