{"id":14956040,"url":"https://github.com/afomera/trix","last_synced_at":"2025-09-29T23:32:07.825Z","repository":{"id":45393820,"uuid":"99970584","full_name":"afomera/trix","owner":"afomera","description":"Easily drop the Trix WYSIWYG editor into your Ruby on Rails application.","archived":false,"fork":true,"pushed_at":"2021-12-16T05:44:47.000Z","size":509,"stargazers_count":86,"open_issues_count":7,"forks_count":29,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-11T13:36:59.350Z","etag":null,"topics":["ruby-gem","ruby-on-rails","trix","wysiwyg"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"maclover7/trix","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/afomera.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-10T22:45:54.000Z","updated_at":"2024-12-17T07:51:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/afomera/trix","commit_stats":null,"previous_names":["kylefox/trix"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afomera%2Ftrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afomera%2Ftrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afomera%2Ftrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afomera%2Ftrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afomera","download_url":"https://codeload.github.com/afomera/trix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234673608,"owners_count":18869699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ruby-gem","ruby-on-rails","trix","wysiwyg"],"created_at":"2024-09-24T13:12:13.540Z","updated_at":"2025-09-29T23:32:07.354Z","avatar_url":"https://github.com/afomera.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# Trix for Ruby on Rails\n\n[![Build Status](https://api.travis-ci.org/kylefox/trix.svg)](https://travis-ci.org/kylefox/trix)\n\nWant to include Basecamp's awesome [Trix WYSIWYG\neditor](http://trix-editor.org) in your Ruby on Rails application?\nYou've come to the right place!\n\nCompatible with Rails 5.2 and up.\n\n_Note: trix-rails 2.x is technically compatible with Rails 4.2 and up, but is no longer tested or maintained. Support for \u003c Rails 5.2 will be dropped in trix-rails 3.x_\n\n# Installation\n\nAdd `trix-rails` to your `Gemfile`:\n\n```ruby\ngem 'trix-rails', require: 'trix'\n```\n\nRun `bundle install` and restart your server to make the files available through the pipeline.\n\nImport Trix styles in `app/assets/stylesheets/application.css`:\n\n```css\n*= require trix\n```\n\nRequire Trix Javascript magic in `app/assets/javascripts/application.js`:\n\n```js\n//= require trix\n```\n\n# Usage\n\nYou can use `trix-rails` as a standalone tag, in a form builder, or with popular form libraries.\n\n## Standalone Tag\n\nCreate a simple `\u003ctrix-editor\u003e` tag:\n\n```ruby\ntrix_editor_tag(name, value = nil, options = {})\n```\n\nFor example:\n\n```erb\n\u003c%= trix_editor_tag :post, :body, required: true %\u003e\n```\n\n## Form builder\n\nCreate a Trix editor for a `form_for` or `form_with` attribute:\n\n```ruby\ntrix_editor(method, options = {})\n```\n\nFor example:\n\n```erb\n\u003c%= post_form.trix_editor :body, required: true, autofocus: true %\u003e\n```\n\n## Formtastic and Simple Form\n\nIf you're using [Formtastic](https://github.com/justinfrench/formtastic) or [Simple Form](https://github.com/plataformatec/simple_form), you can do this:\n\n```ruby\nf.input :body, as: :trix_editor\n```\n\n## Options\n\nAny `options` provided will be passed along to the [`content_tag`](https://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-content_tag) call that outputs the `\u003ctrix-editor\u003e` tag.\n\nFor example:\n\n```erb\n\u003c%= post_form.trix_editor :body, autofocus: true, data: { coffee: :delicious } %\u003e\n```\n\nwill render:\n\n```html\n\u003ctrix-editor autofocus=\"true\" data-coffee=\"delicious\"\u003e\u003c/trix-editor\u003e\n```\n\n# Contributing\n\nBug reports and feature requests are welcome. They're _much_ more likely to be addressed if they are accompanied by a pull request 😘\n\n- [Report a bug](https://github.com/kylefox/trix/issues/new?template=bug_report.md)\n- [Request a feature](https://github.com/kylefox/trix/issues/new?template=feature_request.md)\n\n## Testing\n\nAll pull requests should include tests, where applicable. Pull requests without tests may be rejected.\n\n`trix-rails` uses [Appraisal](https://github.com/thoughtbot/appraisal) to test against supported versions of Rails. You can run the specs against all supported versions with:\n\n```shell\nbundle exec appraisal rake spec\n```\n\n## Upgrading Trix\n\nTo upgrade Trix, simply copy the _compiled_ styles from [`trix/dist`](https://github.com/basecamp/trix/tree/master/dist) into this repository:\n\n- Copy [`trix.js`](https://raw.githubusercontent.com/basecamp/trix/master/dist/trix.js) to `vendor/assets/javascripts/trix.js`\n- Copy [`trix.css`](https://raw.githubusercontent.com/basecamp/trix/master/dist/trix.css) to `vendor/assets/stylesheets/trix.css`\n\n# License (MIT)\n\n`trix-rails` is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafomera%2Ftrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafomera%2Ftrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafomera%2Ftrix/lists"}