LoginSignup
9
11

More than 5 years have passed since last update.

CarrierWaveでファイルサイズをバリデーションする(3行で)

Posted at

アップローダーに以下3行を入れてください。

def size_range
  1..10.megabytes
end

※ CarrierWave version 1.0.0.beta (2016-09-08) 以上の場合だけです

参考
https://github.com/carrierwaveuploader/carrierwave/wiki/How-to%3A-Validate-image-file-size

9
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
11