{"id":14955578,"url":"https://github.com/blocknotes/activeadmin_trumbowyg","last_synced_at":"2025-10-01T18:31:42.446Z","repository":{"id":26040601,"uuid":"107179714","full_name":"blocknotes/activeadmin_trumbowyg","owner":"blocknotes","description":"Trumbowyg Editor for ActiveAdmin","archived":false,"fork":false,"pushed_at":"2024-02-18T19:15:29.000Z","size":547,"stargazers_count":32,"open_issues_count":2,"forks_count":17,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T11:21:15.093Z","etag":null,"topics":["activeadmin","activeadmin-plugin","rails","rails5","ruby"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blocknotes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["blocknotes"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2017-10-16T20:31:42.000Z","updated_at":"2024-10-23T14:31:54.000Z","dependencies_parsed_at":"2024-06-21T02:36:41.845Z","dependency_job_id":"3358593f-10a2-4b99-992b-bf00157ef2bb","html_url":"https://github.com/blocknotes/activeadmin_trumbowyg","commit_stats":{"total_commits":60,"total_committers":5,"mean_commits":12.0,"dds":"0.43333333333333335","last_synced_commit":"d09f13f60473a0ea7e6429a79ed9cc0d5f299408"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknotes%2Factiveadmin_trumbowyg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknotes%2Factiveadmin_trumbowyg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknotes%2Factiveadmin_trumbowyg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknotes%2Factiveadmin_trumbowyg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blocknotes","download_url":"https://codeload.github.com/blocknotes/activeadmin_trumbowyg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234724467,"owners_count":18877196,"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":["activeadmin","activeadmin-plugin","rails","rails5","ruby"],"created_at":"2024-09-24T13:11:23.867Z","updated_at":"2025-10-01T18:31:37.160Z","avatar_url":"https://github.com/blocknotes.png","language":"JavaScript","readme":"# Active Admin Trumbowyg\n[![gem version](https://badge.fury.io/rb/activeadmin_trumbowyg.svg)](https://badge.fury.io/rb/activeadmin_trumbowyg)\n[![gem downloads](https://badgen.net/rubygems/dt/activeadmin_trumbowyg)](https://rubygems.org/gems/activeadmin_trumbowyg)\n[![linters](https://github.com/blocknotes/activeadmin_trumbowyg/actions/workflows/linters.yml/badge.svg)](https://github.com/blocknotes/activeadmin_trumbowyg/actions/workflows/linters.yml)\n[![specs Rails 6.1](https://github.com/blocknotes/activeadmin_trumbowyg/actions/workflows/specs_rails61.yml/badge.svg)](https://github.com/blocknotes/activeadmin_trumbowyg/actions/workflows/specs_rails61.yml)\n[![specs Rails 7.0](https://github.com/blocknotes/activeadmin_trumbowyg/actions/workflows/specs_rails70.yml/badge.svg)](https://github.com/blocknotes/activeadmin_trumbowyg/actions/workflows/specs_rails70.yml)\n\nAn *Active Admin* plugin to use [Trumbowyg](https://alex-d.github.io/Trumbowyg/) as WYSIWYG editor in form inputs.\n\nFeatures:\n- automatically includes a fast \u0026 lightweight rich editor in Active Admin;\n- customizable options via data attributes in the form input;\n- plugins included, like images upload.\n\n![screenshot](extra/screenshot.png)\n\nPlease :star: if you like it.\n\n## Install\n\n*NOTE*: if you are using Ruby \u003c 3.0, please use Activeadmin Trumbowyg 1.0.0\n\n- Add a SASS/SCSS gem to your Gemfile (ex. `gem 'sassc'`)\n- After installing Active Admin, add to your Gemfile: `gem 'activeadmin_trumbowyg'` (and execute *bundle*)\n- Add at the end of your Active Admin styles (_app/assets/stylesheets/active_admin.scss_):\n```css\n@import 'activeadmin/trumbowyg/trumbowyg';\n@import 'activeadmin/trumbowyg_input';\n```\n- Add at the end of your Active Admin javascripts (_app/assets/javascripts/active_admin.js_):\n```js\n//= require activeadmin/trumbowyg/trumbowyg\n//= require activeadmin/trumbowyg_input\n```\n- Use the input with `as: :trumbowyg` in Active Admin model conf\n- To fix icons in production environment execute the task: `rails trumbowyg:nondigest`\n\n\u003e **UPDATE FROM VERSION \u003c 2.0**: please change the Trumbowyg line in your _app/assets/stylesheets/active_admin.scss_ to: `@import 'activeadmin/trumbowyg/trumbowyg';`\n\n## Usage\n\nForm config (example model Article):\n\n```ruby\nform do |f|\n  f.inputs 'Article' do\n    f.input :title\n    f.input :description, as: :trumbowyg\n    f.input :published\n  end\n  f.actions\nend\n```\n\n## Notes\n\n- **data-options** permits to set *Trumbowyg editor* options directly; some examples below. For reference see [options list](https://alex-d.github.io/Trumbowyg/documentation/).\n-  Why 2 separated scripts/style files? To allow to include different versions of *Trumbowyg editor* if needed.\n- To use this plugins with *Active Admin 1.x* please use the version [0.1.8](https://github.com/blocknotes/activeadmin_trumbowyg/releases/tag/v0.1.8)\n\n## Examples\n\n### Toolbar buttons configuration\n\n```ruby\nf.input :description, as: :trumbowyg, input_html: { data: { options: { btns: [['bold', 'italic'], ['superscript', 'subscript'], ['link'], ['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'], ['unorderedList', 'orderedList'], ['horizontalRule'], ['removeformat']] } } }\n```\n\n### Trumbowyg upload plugin\n\nPlugin reference [here](https://alex-d.github.io/Trumbowyg/documentation/plugins/#plugin-upload).\n\nAdd to *active_admin.js* (after *trumbowyg* require):\n\n```js\n//= require activeadmin/trumbowyg/plugins/upload/trumbowyg.upload\n```\n\nForm field config (example model Article):\n\n```ruby\nunless resource.new_record?\n  f.input :description, as: :trumbowyg, input_html: { data: { options: { btns: [['bold', 'italic'], ['link'], ['upload']], plugins: { upload: { serverPath: upload_admin_post_path(resource.id), fileFieldName: 'file_upload' } } } } }\nend\n```\n\nUpload method (using ActiveStorage):\n\n```ruby\nmember_action :upload, method: [:post] do\n  result = { success: resource.images.attach(params[:file_upload]) }\n  result[:file] = url_for(resource.images.last) if result[:success]\n  render json: result\nend\n```\n\nFor the relevant files of this upload example see [here](examples/upload_plugin_using_activestorage/). Consider that this is just a basic example: images are uploaded as soon as they are attached to the editor (regardless of the form submit), it shows the editor only for an existing record (because of the *upload_admin_post_path*) and it doesn't provide a way to remove images (just deleting them from the editor will not destroy them, you'll need to implement a purge logic for that).\n\n## Changelog\n\nThe changelog is available [here](CHANGELOG.md).\n\n## Do you like it? Star it!\n\nIf you use this component just star it. A developer is more motivated to improve a project when there is some interest. My other [Active Admin components](https://github.com/blocknotes?utf8=✓\u0026tab=repositories\u0026q=activeadmin\u0026type=source).\n\nOr consider offering me a coffee, it's a small thing but it is greatly appreciated: [about me](https://www.blocknot.es/about-me).\n\n## Contributors\n\n- [Mattia Roccoberton](http://blocknot.es): author\n- The good guys that opened issues and pull requests from time to time\n\n## License\n\nThe gem is available as open-source under the terms of the [MIT](LICENSE.txt).\n","funding_links":["https://github.com/sponsors/blocknotes"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblocknotes%2Factiveadmin_trumbowyg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblocknotes%2Factiveadmin_trumbowyg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblocknotes%2Factiveadmin_trumbowyg/lists"}