-
-
Save nicedawg/1a94805ef8141b48b16a0b2faf8d659b to your computer and use it in GitHub Desktop.
[Beginning Rails 6] Listing 9-4. The Updated New Comment Template in app/views/comments/new.js.erb
This file contains 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
document.querySelector("#comments").insertAdjacentHTML("afterend", "<%= escape_javascript render partial: 'new' %>"); | |
var comment_form = document.querySelector("#main form"); | |
comment_form.style.opacity = 0; | |
setTimeout(function() { | |
comment_form.style.transition = 'opacity 1s'; | |
comment_form.style.opacity = 1; | |
}, 10); | |
document.querySelector("#new_comment_link").style.display = 'none'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment