Created
January 28, 2014 13:43
-
-
Save voidius/8667893 to your computer and use it in GitHub Desktop.
Example of custom form builder (RoR)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomFormBuilder < ActionView::Helpers::FormBuilder | |
def text_field_with_error_placeholder field_name | |
text_field field_name, placeholder: (error_message_on field_name).scan(/\>(.*)\</).join(', ').html_safe | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment