small medium large xlarge

08 Jan 2009, 15:10
Jon Roberts (5 posts)

Today I was trying to improve on the way error messages are displayed on a form. Instead of using error_messages_for at the top of the page, I want to put them next to the field with the problem.

Looking through the index of my beta copy of your book I could not see anything about this. I can see that you have to limit the size of the book, but most real life customers will want to see error messages inline.

I made some progress using Ryan Heath’s form_assistant plugin (, he provides partials for each field type, but as yet I could not find the model object and field name in scope within his partials to query the errors hash.

So my suggestion is (because I know you have loads of spare time), inline errors on forms !

I must be missing something because this should not be hard to do.

08 Jan 2009, 19:59
Jon Roberts (5 posts)

Err, I just realised that you are much too far on with the book to do this sort of change.

I will plough on and find out how to do it.

Good luck.

10 Jan 2009, 04:53
Ryan Heath (1 post)

Just to clear things up, my plugin (“form_assistant”: does handle specific errors inline with the corresponding field. The link above is to the old version - see “the updates”:


You must be logged in to comment