現在画像投稿機能を作成しています。
CarrierWaveで画像を投稿するこができるようになったのですが、minimagickを入れて画像を投稿すると画像が投稿できません。
エラーを見るとこのようになっています。
translation missing: ja.errors.messages.mini_magick_processing_error
image_uploader.rbはこのようになっています。
class ImageUploader < CarrierWave::Uploader::Base include CarrierWave::MiniMagick def store_dir "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end version :thumb do process resize_to_fit: [340, 220] end def thumb_url thumb.url end def extension_whitelist %w[jpg jpeg gif png] end end
以下の部分をコメントアウトすると画像は投稿することができます。
version :thumb do process resize_to_fit: [340, 220] end def thumb_url thumb.url end def extension_whitelist %w[jpg jpeg gif png] end
controllerでsaveする前の情報を見て見ると、
{"id":null,"work_id":1,"data":{"url":null,"thumb":{"url":null}},"created_at":null,"updated_at":null}
このように data の中身が入っていませんでした。
formではdataを送っているはずなのになぜ中身が入ってないのでしょうか。
教えていただけると嬉しいです。
あなたの回答
tips
プレビュー