Make a field optional in rails
问题 I use paperclip to attach an avatar to users, which works fine but when a new user attempts to register it complains about the avatar bieng too small and not of the right type. This is how i validate my avatars: validates_attachment_size :avatar, :less_than => 1.megabytes validates_attachment_content_type :avatar, :content_type => ['image/jpeg', 'image/png', 'image/gif'] This is the error i get when i try to register. There were problems with the following fields: * Avatar file size file size