πŸš€ Finally! The Alpha Version of TrixGenius Has Arrived β€” Supercharge Your Trix Editing Experience with AI! πŸ§ 

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?

Article content

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

πŸ” View on RubyGems
# 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

Article content

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

Article content

Leave a comment