small medium large xlarge

Generic-user-small
08 Jan 2009, 15:10
Jon Roberts (6 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 (http://rpheath.com/posts/359-rails-plugin-form-assistant), 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.

Generic-user-small
08 Jan 2009, 19:59
Jon Roberts (6 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.

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

Just to clear things up, my plugin (“form_assistant”:http://github.com/rpheath/form_assistant/tree/master) does handle specific errors inline with the corresponding field. The link above is to the old version - see “the updates”:http://rpheath.com/posts/376-form-assistant-plugin-updates.

Thanks!

You must be logged in to comment