Skip to content

Instantly share code, notes, and snippets.

View david-uhlig's full-sized avatar

David Uhlig david-uhlig

View GitHub Profile
@david-uhlig
david-uhlig / rocket_chat_convert_emails_to_lowercase.md
Last active April 23, 2024 13:27
Rocket Chat: Convert User Emails to Lowercase

Issue

Rocket Chat's password reset feature fails if the user has uppercase characters in their email address, e.g. John.Doe@example.com. An issue has been raised. Until it is resolved, a possible workaround is to convert all your users' email addresses to lowercase.

Workaround

This solution converts all upper case email addresses to lower case. It assumes that Rocket Chat is run through docker compose, but can easily be applied to any other setup with minor changes.

First, create a database dump in case something goes wrong

docker compose exec mongodb sh -c 'mongodump --archive' > db.dump
@david-uhlig
david-uhlig / tinymce-rails7-integration.md
Last active January 14, 2024 12:05
Integration of TinyMCE in Rails 7 with Turbo Drive Support

Integration of TinyMCE in Rails 7 with Turbo Drive Support

Since Rails 7 the turbo-rails library is included by default. Turbo Drive intercepts link clicks and form submits. It makes sure that only the <body> part of the page is rerendered instead of the whole page.

This leads to TinyMCE not being properly detached and reattached when a Turbo Drive response is rendered. The textarea will appear without the TinyMCE editor. In this post we expand on the tinymce-rails gem with a Stimulus controller to prevent this issue. The controller helps to reattach TinyMCE and respects the settings in config/tinymce.yml.

If you want to follow along or check out the end result you can find an example respository here: https://github.com/david-uhlig/example-tinymce-rails7-turbo

Instructions