Trix Gem
Want to include Basecamp's awesome Trix WYSIWYG editor in your Ruby on Rails application? You've come to the right place!
Installation
The trix-gem
makes it easy to drop Trix into Rails with the asset pipeline.
Add this line to your application's Gemfile:
gem 'trix-gem'
And then execute:
$ bundle
Or install it yourself as:
$ gem install trix-gem
Usage
Import Trix styles in app/assets/stylesheets/application.css
:
*= require trix
Require Trix Javascript magic in app/assets/javascripts/application.js
:
//= require trix
Finally, any place where you would like to use the Trix editor in your
forms, just use the trix_editor
helper:
f.trix_editor :body
If you are using the Formtastic gem or the Simple Form gem, you can do this:
f.input :body, as: :trix_editor
Trix
For the official Trix Github repository, go here.
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/DRBragg/trix-gem. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Trix-gem project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.