hostname = window.location.hostname protocol = window.location.protocol port = window.location.port rootURL = "#{protocol}//#{hostname}:#{port}" $('#tasks-list').on 'click', -> params = { url: this.rootURL + '/tasks.json', method: 'GET' } $.ajax(params) .done (items) -> elements = [] items.forEach( (item, index) -> elements.push( "<tr><td>#{item.title}</td>" + "<td><strong data-task-id=#{item.id}