I have a Camping model that has_many Images . Camping requires at least one image:
class Camping < ActiveRecord::Base attr_accessible :images_attributes has_many :images validates_presence_of :images, :message => "At least one image is required" accepts_nested_attributes_for :images, :allow_destroy => true end
Then in active_admin , which uses formtastic , I get an error message. f.semantic_errors least one image is required , with f.semantic_errors :
ActiveAdmin.register Camping do form :html => { :multipart => true } do |f| f.semantic_errors :images
This is displayed as:

Images At least one image is required .
How can I render: At least one image is required ?
changing f.semantic_errors :images to ' f.semantic_errors (deletion: images) makes it display nothing; no mistake at all.
Note. The API documentation seems to imply that Formtastic always adds the name :attribute to the error; but I'm not quite sure how this code works.
source share