Sha256: e1351981289192ea5a02f22f6004fc1e354efd4a47f1d533080005d2849f8102

Contents?: true

Size: 1.73 KB

Versions: 1

Compression:

Stored size: 1.73 KB

Contents

I"Þ(function() {
  var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
    hasProp = {}.hasOwnProperty;

  App.Controllers.Admin.Users = (function(superClass) {
    extend(Users, superClass);

    function Users() {
      return Users.__super__.constructor.apply(this, arguments);
    }

    Users.prototype.index = function() {
      this.view = new App.Views.Admin.Users.List({
        users: []
      });
      this.connectWith([App.Models.User]);
      return App.Models.User.get("all", {}, (function(_this) {
        return function(users) {
          return _this.view.renderUsers(users);
        };
      })(this));
    };

    Users.prototype.show = function() {
      var view;
      view = new App.Views.Admin.Users.Show;
      return App.Models.User.find(this.params.id, (function(_this) {
        return function(user) {
          return view.render(user);
        };
      })(this));
    };

    Users.prototype.edit = function() {
      var view;
      view = new App.Views.Admin.Users.Form({
        user: new App.Models.User({
          id: this.params.id
        })
      });
      return view.render();
    };

    Users.prototype.receivedSignal = function(signal, data) {
      switch (signal) {
        case "User created":
          return App.Models.User.find(data.id, (function(_this) {
            return function(user) {
              return _this.view.renderUsers([user], 'prepend');
            };
          })(this));
      }
    };

    return Users;

  })(App.Controllers.Base);

}).call(this);
:ET

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
loco-rails-0.0.1 test/dummy/tmp/cache/assets/development/sprockets/v3.0/RYYHEoFMWRF9M5-7DNc__18YZtx8go8nIgtIZJqSems.cache