Brian Michel

Joined

1,030 Experience
10 Lessons Completed
0 Questions Solved

Activity

There is a way to do this... on the show page for posts (or in my case, articles), pull the form into it's own div below and give it an ID like such:

<div id="comments">
   <%= render @article.comments.where(parent_id: nil), max_nesting: 4 %> 
</div>
<div id="topform">
   <%= render partial: "comments/form", locals: { commentable: @article } %>    
</div>

Then in your create.js.erb file, target that ID to reset the form in there as well like such:

var form = comments.parentElement.querySelector("form")
form.reset()

var topform = document.getElementById("topform").querySelector("form")
topform.reset()

Scratch that... no issue. My poor spelling was the problem. Only took 45 minutes to figure that out. :/

I'm having an issue where it does not validate the confirmation to the new password. So no matter if the two are different, it simply updates the password with whatever is in the password field.

Earn XP by completing lessons, posting on the forum, and answering forum questions