Ruby/rails NoMethodError? when using custom validation method?

You should pass validation method as symbol.

Up vote 3 down vote favorite share g+ share fb share tw.

Self. Can_send_email end end raises NoMethodError in PeopleController#index undefined method `require_description_presence? ' for # ruby-on-rails ruby validation activerecord link|improve this question edited Jan 17 '10 at 7:47Toby Hede14.9k44378 asked Jan 17 '10 at 6:58lordlinier233.

You can make this even shorter and sweeter. The :if clause will take an attribute just as easily. So if can_send_email is a boolean attribute of Person, this will work: class Person :can_send_email?

End No need to create another method just to check this attribute. And if you notice the extra question mark at the end of can_send_email, it's because Rails lets you do that with boolean attributes. I like it because it makes the code's purpose more clear.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions