Answer the question
In order to leave comments, you need to log in
How to display validation error message for Carrierwave bootloader?
I'm trying to make sure every object has an attached picture when it's created. At the moment I'm running into an issue where I just can't seem to get an error message to be displayed when a picture hasn't been attached. The error simply does not appear on the form, while all other validations are displayed. How can I fix this?
article.rb
class Article < ActiveRecord::Base
validates :picture, presence: true
mount_uploader :picture, ImageUploader
end
= simple_form_for article, remote: true do |f|
= f.hidden_field(:picture_cache)
= f.file_field(:picture)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question