Created
September 7, 2012 13:39
-
-
Save jroes/3666337 to your computer and use it in GitHub Desktop.
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
module ActiveAdmin | |
class FormBuilder < ::Formtastic::FormBuilder | |
# ... | |
# The input method returns a properly formatted string for | |
# its contents, so we want to skip the internal buffering | |
# while building up its contents | |
def input(method, *args) | |
content = with_new_form_buffer { super } | |
return content.html_safe unless @inputs_with_block | |
form_buffers.last << content.html_safe | |
end | |
# ... | |
private | |
def with_new_form_buffer | |
form_buffers << "".html_safe | |
return_value = yield | |
form_buffers.pop | |
return_value | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment