Trix 想在 Ruby on Rails 应用中包含 Basecamp 令人惊叹的 Trix WYSIWYG 编辑器吗? 你来对了! 请参阅 t…
Trix 想在 Ruby on Rails 应用中包含 Basecamp 令人惊叹的 Trix WYSIWYG 编辑器吗? 你来对了! 请参阅 t…
Want to include Basecamp's awesome Trix WYSIWYG editor in your Ruby on Rails application? You've come to the right place!
Please see the appropriate guide for your environment of choice:
trix is easy to drop into Rails with the asset pipeline.
In your Gemfile you need to add the trix gem.
gem 'trix'bundle install and restart your server to make the files available through the pipeline.
Import Trix styles in app/assets/stylesheets/application.css:
*= require trixRequire Trix Javascript magic in app/assets/javascripts/application.js:
//= require trixFinally, any place where you would like to use the Trix editor in your
forms, just use the trix_editor helper:
f.trix_editor :bodyIf you are using the Formtastic gem or the Simple Form gem, you can do this:
f.input :body, as: :trix_editorFor the official Trix Github repository, go here.
Bug reports and pull requests are welcome on GitHub at https://github.com/maclover7/trix.
trix.js to vendor/assets/javascripts/trix.jstrix.css to vendor/assets/stylesheets/trix.csslib/trix/version.rb with the correct version numbergit commit -am 'Bump to vVERSION'bundle exec rake releaseThe gem is available as open source under the terms of the MIT License.
暂无开放 Issues,或尚未同步最近议题。