Replies: 1 comment 3 replies
-
Sure, it's possible to customize the error handler via the :error_handler option. The default inserts a span after the input, but you can customize the handling. You can pass any callable object as the value of :error_handler. It's probably best to review the implementation, as well as see the example of a custom :error_handler in the specs. If you have additional questions after reviewing those, please let me know. Code: https://github.com/jeremyevans/forme/blob/master/lib/forme/transformers/error_handler.rb |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there!
I'm also messing a bit with this gem inside a project and, so far, it's been quite straightforward. Nonetheless, I was surprised to see that error messages are automatically appended next to the corresponding input (which is great).
Then only thing I couldn't figure out and was wondering if it's indeed possible is how to customize generated tags for error messages (e.g. changing classes, tag name or even show them as a
<ul>
instead of consecutive<span>
tags.Thank you very much in advance.
Beta Was this translation helpful? Give feedback.
All reactions