Martin Yanchev
Joined 3/31/2022
Martin Yanchev said over 1 year ago on Bulk Upload with Active Storage :
Hi is anyone else gettingĀ 
ActiveSupport::MessageVerifier::InvalidSignature

The only difference is that I have an Album and this album has_many Image model and this image model has_one attached :file
#image.rb
class Image < ApplicationRecord
  belongs_to :album
  has_one_attached :file
end


#album.rb
class Album < ApplicationRecord
  has_many :images, dependent: :destroy
  accepts_nested_attributes_for :images, allow_destroy: true, reject_if: :all_blank
  has_one_attached :cover_photo


  def self.attributable_params
    [:title,
      :cover_photo,
      images:[],
    ]
  end
end


#the form
<%= form_with url: album_images_uploads_path(@album), multiplart: true   do |form| %>
    <%= form.file_field :file, multiple: true, direct_upload: true %>
    <%= form.submit %>
<% end %>


#images_uploads_controller.rb
class ImagesUploadsController < ApplicationController
  before_action :set_album
  def create
    params[:file].each do |blob|
      @album.images.create(file: blob)
    end
    redirect_to album_path(@album)
  end

  private

  def set_album
    @album = Album.find(params[:album_id])
  end
end


this is what gets send from the form

Martin Yanchev said about 1 year ago on Text to Image with Machine Learning :
Great job the only think I didn't understand was do you ssh into some cloud machine with large computing power and it terms of deploying this where did you deploy the flask micro service.

Martin Yanchev said 12 months ago on Tokenized Search :
Hi just wanted to let you know that the button for full screen is not visible on mobile phones.