When looking at this code:
@user.errors.any?
Where is the errors method defined in Rails 3.2.3, or what should I be looking at in the API to understand it further?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
http://apidock.com/rails/ActiveModel/Errors
http://apidock.com/rails/ActiveResource/Errors
Don’t know what
@useris, although I assume it’s an ActiveRecord model.Depending on what information you’re looking for it’s often easier to use a tool like
pryto “change directories” into a particular object or class. From there you can query the object to determine what methods are available, and you can often look at the source directly from within pry.What kind of information are you looking for regarding
errorsspecifically? IIRC it’s just a hash.