Created
April 21, 2014 14:23
-
-
Save lporras/11144189 to your computer and use it in GitHub Desktop.
Chosen para select simple_form
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
# app/inputs/collection_select_input.rb | |
class CollectionSelectInput < SimpleForm::Inputs::CollectionSelectInput | |
def input_html_classes | |
super.push('chosen-select') | |
end | |
def html_options_for(namespace, css_classes) | |
{data: {:placeholder => I18n.t("helpers.select.prompt")}}.merge!(super(namespace, css_classes)) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment