You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Show < ApplicationRecord
include ImageUploader::Attachment(:artwork)
end
Image Uploader
class ImageUploader < Shrine
plugin :store_dimensions
Attacher.validate do
validate_max_size 1010241024
validate_mime_type %w[image/jpeg image/png]
validate_extension %w[jpg jpeg png]
end
end
def create
@show = Show.new(show_params)
if @show.save
flash[:notice] = "The new show has been added to your account"
redirect_to @show
else
render :new
end
end
private
def show_params
params.require(:show).permit(:title, :artwork)
end
Do you know what this could be?
The text was updated successfully, but these errors were encountered:
Either fog or fog-backblaze could be requiring file content to be given on upload instead of a file object. Either that or an actual File instance is required, which can be obtained using Shrine.with_file.
@janko Thanks for your reply, apologises as it’s not really something I am really clued up on. Is this something that I can alter my side through the uploader or some other way?
I seem to be getting the following error when submitting my form for my model:
no implicit conversion of ActionDispatch::Http::UploadedFile into String
Some details of my setup are below:
Rails 6.0.2.2
Ruby 2.6.0p0
gem 'fog-backblaze', '> 0.3.0’
gem 'shrine-fog', '> 2.0', '>= 2.0.1’
gem 'shrine', '~> 3.2', '>= 3.2.1'
Model
Image Uploader
Shrine.rb
Controller Code Where it is blowing up
Do you know what this could be?
The text was updated successfully, but these errors were encountered: