public Method

Errors.each_full() { |msg| ... }

Yields each full error message added. So Person.errors.add("first_name", "can’t be empty") will be returned through iteration as "First name can’t be empty".

Examples

my_person = Person.new(params[:person])

my_person.errors.add('login', 'can not be empty') if my_person.login == ''
my_person.errors.add('password', 'can not be empty') if my_person.password == ''
messages = ''
my_person.errors.each_full {|msg| messages += msg + "<br />"}
messages
# => "Login can not be empty<br />Password can not be empty<br />"

Source Code

# File active_resource/validations.rb, line 145
def each_full
  full_messages.each { |msg| yield msg }
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.