Skip to content

Instantly share code, notes, and snippets.

View bsimpson's full-sized avatar

Ben Simpson bsimpson

View GitHub Profile
@bsimpson
bsimpson / gist:2312761
Created April 5, 2012 17:40
Error message display

Introduction

Error messages are currently not handled in a consistent manner in Batchdeux's forms. I have modified the field_error_proc method which serves as a global way to change the behavior of form errors. By modifying this, I have given us the option to display errors in several ways:

Demo

git fetch
git checkout bls/23176299_data_validation_errors

Be sure to restart your webserver, as changes have been made to the config/ directory

@bsimpson
bsimpson / gist:2312760
Created April 5, 2012 17:39
Error message display
# Introduction
Error messages are currently not handled in a consistent manner in Batchdeux's forms. I have modified the `field_error_proc` method which serves as a global way to change the behavior of form errors. By modifying this, I have given us the option to display errors in several ways:
# Options
Options can be passed on an individual `:input` basis.
* `suppress_error` - Do not show any inline errors
* `error_before` - Show the label tag before the :input tag
A hungry bloke staggering through the desert finds two Bedouins, and asks if he can share bread with them.
The tall Bedouin has 5 loaves, the short Bedouin has 3 loaves of bread.
They welcome the visitor, and the three of them consume the 8 loaves of bread.
The stranger thanks the Bedouins for their hospitality, and leaves them with 8 gold coins.
The tall Bedouin takes 5 coins, leaving three.
But the short Bedouin says they both shared their bread, and therefore should split the 8 coins four and four.
Question:
Which if either of the two Bedouins is right?