Tag Archives: RoR

How to use reCaptcha Validation on Ruby On Rails

Security should always be an issue when it comes to computer applications.
Web applications and websites are even more exposed, so likely every weak spot will be exploited someday.

For years, web forms have been used by robots, spreading spam on most websites.

Captcha appeared in order to verify if the user accessing the form is human or not. It does that by showing an image with a text. The image cannot be converted into text by any OCR mechanism, but the human user is still able to read.

So how can we use recaptcha (www.recaptcha.net) with rails?
Continue reading “How to use reCaptcha Validation on Ruby On Rails” »

Custom foreign keys on Ruby on Rails Active Record

ActiveRecord, like all ORM’s, is one of the greatest things on earth, IMHO :)

By using the Convention or Configuration approach, ActiveRecord and even Rails, allows you to skip a few parts and go straight to what matters: the development.

sometimes, though, the “Sensible defaults” of rails and ActiveRecord are’t enough, but like most ORM’s, the convention can easily be overridden in order to get things done.

When you add a relationship between classes all you have to do is to add a references and has_many on the other side. If you follow the naming rules everything works.

Continue reading “Custom foreign keys on Ruby on Rails Active Record” »