JSON::ParserError in RecipesController#update
743:unexpected token at'shakshuka.jpg'require "image_processing/mini_magick"
class ImageUploader < Shrine
include ImageProcessing::MiniMagick
plugin :determine_mime_type plugin :logging, logger: Rails.logger plugin :remove_attachment plugin :store_dimensions plugin :versions, names: [:original, :thumb] plugin :backgrounding
def process(io, context) case context[:phase] when :store thumb = resize_to_limit!(io.download, 200, 200) { original: io, thumb: thumb } end endenddef update respond_to do |format| if @recipe.update(recipe_params) format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' } format.json { render :show, status: :ok, location: @recipe } else format.html { render :edit } format.json { render json: @recipe.errors, status: :unprocessable_entity } end end endrequire "shrine"require "shrine/storage/s3"
s3_options = { access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'), secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY'), region: 'us-west-2', bucket: ENV.fetch('S3_BUCKET_NAME')}
Shrine.storages = { cache: Shrine::Storage::S3.new(prefix: "cache", **s3_options), store: Shrine::Storage::S3.new(prefix: "store", **s3_options),}
Shrine.plugin :activerecordShrine.plugin :cached_attachment_datainclude ImageUploader[:image]
--
You received this message because you are subscribed to the Google Groups "Shrine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-shrine...@googlegroups.com.
To post to this group, send email to ruby-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ruby-shrine/ec594788-7bcc-4fcb-bead-273845896aa2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
The `file` command-line tool is not installed
To view this discussion on the web visit https://groups.google.com/d/msgid/ruby-shrine/3b89ad61-9eb3-48b2-ae20-3eac150a796f%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Shrine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-shrine+unsubscribe@googlegroups.com.
To post to this group, send email to ruby-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ruby-shrine/73b86372-38bb-4405-ba80-1775cfca2179%40googlegroups.com.