Sha256: 8774eae8e0e7e9be0845145d2eb4f58256a74758bda134a01dd976fd5e765409

Contents?: true

Size: 651 Bytes

Versions: 1

Compression:

Stored size: 651 Bytes

Contents

class App.Controllers.Admin.Users extends App.Controllers.Base
  index: ->
    @view = new App.Views.Admin.Users.List users: []
    this.connectWith [App.Models.User]
    App.Models.User.get("all").then (resp) => @view.renderUsers resp.resources

  show: ->
    view = new App.Views.Admin.Users.Show
    App.Models.User.find(@params.id).then (user) => view.render user

  edit: ->
    view = new App.Views.Admin.Users.Form user: new App.Models.User id: @params.id
    view.render()

  receivedSignal: (signal, data) ->
    switch signal
      when "User created"
        App.Models.User.find(data.id).then (user) => @view.renderUsers [user], 'prepend'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
loco-rails-0.0.1 test/dummy/app/assets/javascripts/controllers/admin/users.coffee