
April 10, 2025
After many late-night commits, experiments, and way too much mate β β Iβm incredibly excited to introduce the alpha release of a gem Iβve been crafting with love:
TrixGenius β A smart extension for Trix + ActionText + Hotwire.
π Supercharge Your Trix Editor with DeepSeek AI in Ruby on Rails
Discover TrixGenius, a free and open-source Ruby gem that seamlessly integrates DeepSeek AI into the native Trix WYSIWYG editor used in Ruby on Rails applications. Enjoy features like smart text correction, AI-enhanced content suggestions, and more β all within your Rails app.
π View the Gem on RubyGemsπ€ Want to Add AI to Your Ruby on Rails App?
If you’re looking to bring AI features like spelling correction, natural language processing, or smart assistants into your Rails application, Iβd love to help!
π Letβs Build Something Amazing Togetherπ§ What is TrixGenius?

TrixGenius is a Rails engine and generator that adds AI-powered buttons to your Trix Editor using Stimulus and Turbo.
In this alpha version, Iβm proud to ship a working button that uses AI (DeepSeek or your favorite API) to automatically correct spelling in Trix inputs β all with a single click.
This is just the beginning. The idea is to enhance the Trix experience with intelligent, modular enhancements that plug into your Rails app easily.
π§© Whatβs Included in the Alpha?
β AI button: “Correct Spelling” via API
β rails g trix_genius:install generator
β Fully Stimulus-powered Trix extension
β Automatic route injection
β Auto setup for JS imports
β RSpec Generator tests
β Ready-to-hack Stimulus controller for more IA buttons
π¦ Get trix-genius
The first alpha release</strong of trix-genius is now available! Enhance your Trix editor with AI-powered features today. π‘
π Gem name: trix-genius
π Version: 0.1.0
# Gemfile
gem "trix-genius", "~> 0.1.0"
π§ Installation (Rails 7 / JS Bundler or Importmap)
Add to your Gemfile:
gem "trix_genius"
Then install ActionText if you haven’t yet:
bin/rails action_text:install
Create a scaffold (optional):
bin/rails g scaffold Post title body:rich_text bin/rails db:migrate
Then run the gemβs generator:
bin/rails g trix_genius:install
This will:
- Create the initializer
- Inject needed imports in application.js and controllers/application.js
- Add the controller (trix_genius_controller.rb)
- Add JS controller (trix_genius_controller.js)
- Inject the route:
post "/trix_genius/correct_spelling", to: "trix_genius#correct_spelling"
π§ͺ Generator Spec Coverage
Yes, this gem ships with RSpec tests for the generator! Hereβs an example:
it "adds AI route to correct spelling" do
run_generator
assert_file "config/routes.rb" do |content|
expect(content).to include('post "/trix_genius/correct_spelling"')
end
end
Youβll find specs covering:
- Route injection
- Stimulus controller creation
- application.js updates
- Fallback warnings when files donβt exist
π οΈ Extensible by Design
Want to add more buttons like:
- Summarize Text
- Translate Paragraph
- Rephrase for Tone
Just extend the controller or hook into the route and Stimulus actions β itβs designed to be hackable.
π Developer Experience Matters
We believe in:
- Zero config
- Instant feedback
- Helpful messaging
- Undo safety
Thatβs why our generator not only creates files but gives fallback messages with example content, like this:
def javascript_application_msg
<<~MSG
β οΈ You should create the file manually:
π app/javascript/application.js
π‘ With the following content:
...
MSG
end
π¬ Why I Built This

I wanted a way to make rich text editing smarter and more helpful, especially for apps where users are writing a lot. Whether it’s blog platforms, admin panels, or messaging systems β helping users write better and faster just made sense.
And of course⦠I wanted a smooth install. I hate wiring things up manually. This gem does the setup for you.
π Try It Out or Collaborate!
Check out the code, give it a spin, and feel free to open issues or ideas:
π GitHub β TrixGenius π gem ‘trix_genius’
Big shoutout to the amazing OSS ecosystem around Rails, Hotwire, and Stimulus that makes building stuff like this so fun. π
π If you’re building AI features into Rails apps or love messing with rich-text UX β let’s connect and share ideas!
#rails #rubyonrails #opensource #stimulusjs #hotwire #actiontext #ai #gems #developer #buildinpublic
