Skip to content

Image upload with ActiveStorage#1

Draft
wvengen wants to merge 1 commit into
mainfrom
activestorage
Draft

Image upload with ActiveStorage#1
wvengen wants to merge 1 commit into
mainfrom
activestorage

Conversation

@wvengen
Copy link
Copy Markdown
Owner

@wvengen wvengen commented Nov 6, 2023

  • Prototype
  • Make it work with and without importmaps
  • Detect when to enable ActiveStorage and when not (improve detection), see also ActionText detection in app/assets/javascripts/rails_admin/application.js.erb produces false positives railsadminteam/rails_admin#3659
  • Use url helpers (or alternative) to generate ActiveStorage paths, when possible
  • Allow enabling/disabling with option
  • Let TinyMCE work with absolute paths (it translates it to a fully relative path, which breaks rendering in other contexts). Or use an absolute URL (but that is less portable, not preferred).
  • Provide guidance / helpers on coupling uploaded images to the model (so model deletion also removes the images).

@wvengen
Copy link
Copy Markdown
Owner Author

wvengen commented Nov 13, 2023

ActionText gets the image (preview) URL by including a URL template for uploaded images here: https://github.com/rails/rails/blob/main/actiontext/app/helpers/action_text/tag_helper.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant