Sha256: 856f69495b66060b2ff3113c83fbf6473ea14bdefd131170158b7358b5388c67

Contents?: true

Size: 678 Bytes

Versions: 2

Compression:

Stored size: 678 Bytes

Contents

import { Views } from "loco-js";

class Show extends Views.Base {
  constructor(opts = {}) {
    super(opts);
    this.user = opts.user;
  }

  render() {
    document.getElementById("user_email").textContent = this.user.email;
    document.getElementById("user_username").textContent = this.user.username;
    document.getElementById("user_confirmed").textContent = this.user.confirmed
      ? "Yes"
      : "No";
    this._updateEditLink();
  }

  _updateEditLink() {
    const editLink = document.getElementById("edit_link");
    const href = editLink.getAttribute("href");
    editLink.setAttribute("href", href.replace("/0/", "/#{@user.id}/"));
  }
}

export default Show;

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
loco-rails-3.0.5 test/dummy/frontend/js/views/admin/users/Show.js
loco-rails-3.0.4 test/dummy/frontend/js/views/admin/users/Show.js