Save 36% for Black Friday! Save 36% on GoRails for Black Friday! Learn more
Richard Ludwig
Joined
10 Experience
0 Lessons Completed
0 Questions Solved
Activity
Using rails 6, I couldn't get the coffeescript to work, so I converted it to javascript
Put this in your chatroom show page as a workaround under the message input form.
(function() { $(document).on("turbolinks:load", function() { return $("#new_message").on("keypress", function(e) { if (e && e.keyCode === 13) { e.preventDefault(); $(this).submit(); return e.currentTarget.submit(); } }); }); }).call(this);