Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (17 sloc) 522 Bytes
<%= view_namespace %> ||= {}
class <%= view_namespace %>.EditView extends Backbone.View
template: JST["<%= jst 'edit' %>"]
events:
"submit #edit-<%= singular_name %>": "update"
update: (e) ->
e.preventDefault()
e.stopPropagation()
@model.save(null,
success: (<%= singular_name %>) =>
@model = <%= singular_name %>
window.location.hash = "/#{@model.id}"
)
render: ->
@$el.html(@template(@model.toJSON() ))
this.$("form").backboneLink(@model)
return this
Jump to Line
Something went wrong with that request. Please try again.