Created
October 18, 2012 16:51
-
-
Save dejan/3913203 to your computer and use it in GitHub Desktop.
SF CollectionSelectInput monkey patch
This file contains hidden or 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
# This is a monkey patch for the SimpleForm issue (actually it's a Rails' collection_select issue) | |
# of adding attributes to select options. Downside is that you loose value/label_method options, | |
# but that's easily replacable by using map on the collection (and should be done in some decorator anyways). | |
# See here for more details about the issue: https://github.com/plataformatec/simple_form/issues/188 | |
module SimpleForm | |
module Inputs | |
class CollectionSelectInput < CollectionInput | |
def input | |
@builder.select attribute_name, collection, input_options, input_html_options | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment