New chat
Say I want to create the following with a Ruby on Rails app:
A visual text editor that will save in markdown format and accepts drap & drop image uploads
Then transform the markdown into an email format
What would you recommend to use? Any solution already built?
For creating a visual text editor in a Ruby on Rails application that saves in markdown format and accepts drag & drop image uploads, followed by transforming the markdown into an email format, consider the following approach:
-
Visual Text Editor with Markdown and Image Uploads:
- Use a JavaScript-based rich text editor like Trix or Quill. Both are well-integrated with Rails through Active Storage for handling file uploads, including drag & drop functionality.
- For markdown support, you can use a library like Markdown-it which allows you to convert HTML generated by the text editor into markdown format.
-
Handling Image Uploads:
- Use Rails' Active Storage for uploading images. Integrate this with your text editor so that uploaded images are stored and referenced correctly in your application.
- For drag & drop functionality, you can enhance the text editor's capabilities using custom JavaScript or leveraging existing libraries that integrate with your chosen editor.
-
Converting Markdown to Email Format:
-
Integration:
- The integration involves setting up the text editor in your Rails views, configuring Active Storage for image uploads, and adding the necessary backend processing to convert the content to markdown and then to email-friendly HTML.
-
Existing Solutions:
- While there might not be a one-size-fits-all existing solution for this specific workflow, leveraging the combination of Rails capabilities with these JavaScript libraries and Ruby gems can efficiently achieve the desired functionality.
This approach balances the flexibility of a customized solution with the robustness of well-supported libraries and frameworks.