Richard Ludwig

Joined

10 Experience
0 Lessons Completed
0 Questions Solved

Activity

Posted in Group Chat with ActionCable: Part 3 Discussion

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);