Sha256: 0add2586d818da6d5112476989545f7ac1f4a25af3c6cb3c53da01f8f04a3d44

Contents?: true

Size: 369 Bytes

Versions: 8

Compression:

Stored size: 369 Bytes

Contents

<%= view_namespace %> ||= {}

class <%= view_namespace %>.<%= singular_name.camelize %>View extends Backbone.View
  template: JST["<%= jst singular_name %>"]

  events:
    "click .destroy" : "destroy"

  tagName: "tr"

  destroy: () ->
    @model.destroy()
    this.remove()

    return false

  render: ->
    $(@el).html(@template(@model.toJSON() ))
    return this

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rails-backbone-0.8.0 lib/generators/backbone/scaffold/templates/views/model_view.coffee
rails-backbone-0.7.2 lib/generators/backbone/scaffold/templates/views/model_view.coffee
rails-backbone-0.7.1 lib/generators/backbone/scaffold/templates/views/model_view.coffee
rails-backbone-0.7.0 lib/generators/backbone/scaffold/templates/views/model_view.coffee
rails-backbone-0.6.1 lib/generators/backbone/scaffold/templates/views/model_view.coffee
rails-backbone-0.6.0 lib/generators/backbone/scaffold/templates/views/model_view.coffee
rails-backbone-0.6.0.rc lib/generators/backbone/scaffold/templates/views/model_view.coffee
rails-backbone-0.5.5 lib/generators/backbone/scaffold/templates/views/model_view.coffee