import ApplicationController from './application_controller' export default class extends ApplicationController { static targets = ["input"] connect () { super.connect() } search () { var $this = this $.get("/api/documents.json", { q: $this.inputTarget.value }, function (data, status) { if (status === "success") { $this.stimulate("DocumentReflex#render_index_table", data, $this.element.dataset["documentId"], $this.element.dataset["doctrineId"]) } }); } loadYears () { var $this = this $.get("/api/jurisprudences/years.json", {}, function (data, status) { if (status === "success") { $this.stimulate("DocumentReflex#render_years", data) } }); } }