ActiveStorage bridge was a contribution, I didn't write it, I haven't tried ActiveStorage yet. However, I can see form_ui is calling helper for list and show actions to display content, as other bridges related to file upload do.
Form_ui has this line:
content = active_scaffold_column_active_storage_has_one(record, column) if active_storage.attached?
That line display content with same helper as list and show. And that helper, active_scaffold_column_active_storage_has_one method has this line:
attachment.attached? ? link_for_attachment(attachment) : nil
But link_for_attachment doesn't display thumbnail:
def link_for_attachment(attachment)
link_to(attachment.filename, rails_blob_url(attachment, disposition: 'attachment'), target: '_blank')
end
I think that helper method must be changed to display thumbnail, as other bridges do. Carrierwave bridge display thumbnail, and thumbnail style name can be changed in bridge config. Paperclip do it in same way. Dragonfly do it in same way too, but it allows to set :thumb option in column's options. What is code to display thumbnail with ActiveStorage?
--
You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails Gem" group.
To unsubscribe from this group and stop receiving emails from it, send an email to activescaffol...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/activescaffold/3bf5a081-ede1-4402-bf52-1f518063b4af%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to activescaffold+unsubscribe@googlegroups.com.
I think you can override that helper in your controller helper, or ApplicationHelper. I think it should work as dragonfly does, there should be a thumbnail_variant setting in ActiveScaffold::Bridges::ActiveStorage::ActiveStorageBridgeHelpers, default to something like {resize_to_limit: [nil, 30]} to use same values as dragonfly bridge.
I have added this to master branch. However, I have checked docs for activestorage in rails 5.2 and I don't see resize_to_limit option, did it changed in 6.0?
I'm not sure what you want about the other question. Do you want to keep uploaded file so user doesn't need to upload it again? Or do you want to have input file prefilled so user doesn't have to browse file to upload again? The former, I don't know, does it rails save attachment into active_storage_blobs table? It could be orphaned if form is not submitted again. The latter, I think it isn't possible, I think browser doesn't allow to set value attribute for input file tag.
To unsubscribe from this group and stop receiving emails from it, send an email to activescaffol...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/activescaffold/3bf5a081-ede1-4402-bf52-1f518063b4af%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails Gem" group.
To unsubscribe from this group and stop receiving emails from it, send an email to activescaffol...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/activescaffold/cc2b370b-1a3a-4ae1-91bf-ff91e0ae92a2%40googlegroups.com.
A way could be using JS to display error messages instead of replacing form, although fields won't get any class to highlight them with CSS, unless JS make some changes to existing fields too.
To view this discussion on the web visit https://groups.google.com/d/msgid/activescaffold/21720775.6Emhk5qWAg%40pc-sergio.
To view this discussion on the web visit https://groups.google.com/d/msgid/activescaffold/83f86fd3-1b36-4d40-a504-cc5022698e1dn%40googlegroups.com.
Did you mean? ActiveStorageVariant
Hi
Nice it's working. I found how to rotate image with imagemagick, I don't know if it's something you can use:
I don't think ActiveScaffold works with rails 7.0 yet, I haven't tested, but every version usually has some issues.
Regards