Archive for March, 2008

Custom validation with rails: words with more than 26 characters

Friday, March 21st, 2008

This validation goes through and validates each individual word in your string. This goes in whatever model you’re validating. “Subject” can be any of the symbols in your model and doesn’t need the : in front of it.

def validate
if subject.split.any?{|w| w.length > 26}
errors.add(:subject, “cannot have words more than 26 consecutive characters”)

Custom errors on validations for Rails

Wednesday, March 12th, 2008

The default Rails way of doing validate error messages is sort of silly. It works, but it doesn’t work that well. You can iterate through all the error messages in a very constrained way (error_messages_for) or you can display errors on fields one by one (error_message_on). I kind of want functionality from [...]

a changed jessecrouch (dot com)

Sunday, March 2nd, 2008

In recent days I have been making some major content changes to The focus is now more on my skillset and not so much my past (and severely outdated) projects.

I've left the country and this site is just an archive! Check out my trip blog!