app/assets/javascripts/models/domain.coffee.erb in rmails-0.2.2 vs app/assets/javascripts/models/domain.coffee.erb in rmails-0.2.3

- old
+ new

@@ -9,20 +9,21 @@ update : (attrs, domain ) -> url = unescape('<%= Rails.application.routes.url_helpers.domain_path('{id}') %>').replace('{id}', domain.id) return $.post(url, attrs, null, "json") - destroy : ('DELETE ' + unescape('<%= Rails.application.routes.url_helpers.domain_path('{id}') %>')) + destroy : (item, callback) -> + url = unescape('<%= Rails.application.routes.url_helpers.domain_path('{id}') %>').replace("{id}", item.id) + return $.post(url, {"_method":"DELETE"}, callback, "json") attributes: { virtual_users: 'Models.User.models', virtual_aliases: 'Models.Alias.models' }, init: () -> - @validatePresenceOf ['name'] - #@validateFormatOf ['name'], /\A(?:[-a-z0-9]+\.)+[a-z]{2,}\Z/i + @validateFormatOf ['name'], /^(?:[-a-z0-9]+\.)+[a-z]{2,}$/i }, {}) window.Domain.List = can.Model.List({ with_id: (id) ->