How install Action Text without Active Storage?
Asked Answered
J

2

9

I want to add action text to my app. But it also sets Active Storage. I already use CarrierWave, and don't need Active Storage. By the way, I do not need to upload files in the editor at all.

Jackstraw answered 8/1, 2020 at 16:14 Comment(0)
S
4

ActionStorage is a hard dependency for ActionText.

# rails/actiontext/actiontext.gemspec
# frozen_string_literal: true

version = File.read(File.expand_path("../RAILS_VERSION", __dir__)).strip

Gem::Specification.new do |s|
  s.platform    = Gem::Platform::RUBY
  s.name        = "actiontext"
  s.version     = version
  s.summary     = "Rich text framework."
  s.description = "Edit and display rich text in Rails applications."

  # ...
  s.add_dependency "activesupport", version
  s.add_dependency "activerecord",  version
  s.add_dependency "activestorage", version
  s.add_dependency "actionpack",    version

  s.add_dependency "nokogiri", ">= 1.8.5"
end

So you can either just live with it (ActionStorage and CarrierWave can co-exist) or use any the many other WYSIWYG alternatives or integrate Trix and Rails yourself.

Supination answered 8/1, 2020 at 17:12 Comment(0)
N
3

If you dont need to upload files at all then it should be reasonably easy to avoid adding ActiveStorage.

Go to https://github.com/basecamp/trix and follow their instructions how to setup Trix editor in Rails app. Just don't add trix to your Gemfile, but rather rely on what you have from Rails.

In case you would like to add files upload, you will need to play with overwriting trix-attachment-add event and setting files href to permanent URL, under which Trix can always find it.

Nappy answered 29/6, 2020 at 9:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.