方法
今回は自分用ですが、皆さんのお役にも立つかと思ったため記述させてただきます
app/models/item.rb
〜前略〜
has_many_attached :images
〜後略〜
appcontrollers/items_controller
〜前略〜
def edit
@item = Item.find(params[:id])
end
〜後略〜
上記の条件でactive_storageを紐づけている場合、下記の記述でimagesのidを表示できます
app/views/item/edit
= @item.images_blob_ids
おまけ
条件が同じの場合,全ての画像を表示する方法は下記の通りとなります。
app/views/item/edit
-@item.images.each do |image|
=image_tag image
end