Commit 6a8f0c9f
Changed files (1)
app
assets
javascripts
backbone
models
app/assets/javascripts/backbone/models/profile.js.coffee
@@ -13,6 +13,10 @@ class CakeSide.Models.Profile extends Backbone.Model
facebook: null
twitter: null
+ validate: (attributes, options) ->
+ return "Name can't be blank" unless attributes.name && attributes.name.trim()
+ return "Email can't be blank" unless attributes.email && attributes.email.trim()
+
class CakeSide.Collections.ProfilesCollection extends Backbone.Collection
model: CakeSide.Models.Profile
url: '/api/v1/profiles'