Created
October 16, 2014 05:03
-
-
Save codemilan/d712a50e370cd430cae3 to your computer and use it in GitHub Desktop.
File size validator- presence true not working
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'file_size_validator' | |
class Song < ActiveRecord::Base | |
mount_uploader :attachment, AttachmentUploader | |
validates :attachment, :presence => true, | |
:file_size => {:maximum => 2.megabytes.to_i} | |
end | |
when I submit form without file or empty form it gives error : | |
ActionController::ParameterMissing at /songs | |
param is missing or the value is empty: song | |
- since I'm new to rails does validates :presence => true not working or the problem is any thing else. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment