Tag Archive for 'flash'

Rails Tidbits: error_messages_for as a flash.

After not wanting to clutter my interface with the the default error_messages_for style I decided that I would display it as a flash message. I warn you though, it is not pretty.


errors = @folder.errors.to_a.collect { |key,value| key = key.capitalize + " " + value } # We have to do this because without it, there is no space and the key field is all lowercase.
flash[:error] = errors.to_sentence

0 Comments