carrierwaveuploader / carrierwave

Classier solution for file uploads for Rails, Sinatra and other Ruby web frameworks
https://github.com/carrierwaveuploader/carrierwave
8.78k stars 1.66k forks source link

Accompanying alt text for multiple file uploads #2639

Closed dvodvo closed 2 months ago

dvodvo commented 2 years ago

While carrierwave allows the uploading of mutiple files using a JSON data type (postgresql and mysql), AFAIK the rails file_field does not have an accessor in order to set the alt attribute for the tag in order to support accessibility.

With a json column, it would make sense to create a has with the image data and atl_text as distinct elements.

Is there any way to achieve this?

mshibuya commented 2 months ago

There's no ready-made way to do so. Still you can store alt text (or whatever you want) in your model attributes, so it can be used later.