Permalink
Browse files

add section of how to enable chosen to readme

  • Loading branch information...
1 parent 57722d9 commit 8f25248aab7d5e03086a7f37843fb5552f8c37de @tsechingho committed Feb 18, 2013
Showing with 24 additions and 0 deletions.
  1. +24 −0 README.md
View
24 README.md
@@ -30,6 +30,30 @@ Add to your `app/assets/stylesheets/application.css`
*= require chosen
+### Enable chosen javascript by specific css class
+
+Add to one coffee script file, like `scaffold.js.coffee`
+
+ $ ->
+ # enable chosen js
+ $('.chzn-select').chosen
+ allow_single_deselect: true
+ no_results_text: 'No results matched'
+
+
+And this file must be included in `application.js`
+
+ //= require chosen-jquery
+ //= require scaffold
+
+Also add the class to your form field
+
+ <%= f.text_field :author, class: 'chzn-select' %>
+
+If you use simple form as form builder
+
+ <%= f.input :author, input_html: { class: 'chzn-select' } %>
+
## Gem maintenance
Maintain `chosen-rails` gem with `Rake` commands.

0 comments on commit 8f25248

Please sign in to comment.