Handling Multiple File Uploads in Rails 7 | Ruby on Rails 7 Tutorial

preview_player
Показать описание
By default in Rails, attaching files to a has_many_attached association will replace any existing attachments. Let's fix that.

Source:

Join this channel to help support these videos:

Follow me on social media:

#Deanin #Software #Programming
Рекомендации по теме
Комментарии
Автор

Maybe a bit stupid question, but wouldn't it be easier to have stimulus controller that on click will remove the signed_id for the specific image and hide it, that way we won't have to refresh the page and losing any other changes that the user made. And the image will be purged later from the default active storage job that deletes attachments that are not associated.

mycode
Автор

Isn't it better to just delete the hidden_input with js and then let the save button delete the image?

kodokudeusotsuki
Автор

Also thank you for this video it was really helpful

mycode