Created
October 10, 2018 20:30
-
-
Save bchase/a7e3d902455d94ec32358fd8dd8cad03 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app/assets/javascripts/jobs/show.js | |
$(document).ready(function(){ | |
const displayJobDetails = function (job) { | |
$('#foo').append(JobView.renderJobShow(job)) | |
} | |
}) | |
// // jobs/show.html.erb | |
// ... | |
// = javascript_tag 'jobs/show.js' ^ | |
// app/assets/javascripts/job/view/JobView.js | |
class JobView { | |
static renderJobShow(job) { | |
$('<div>', {}, [ renderJobTitle(job), ... ]) | |
} | |
static renderJobTitle(job) { ... } | |
static renderJobAppliedBtn(job) { ... } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment