synth / better_select

This simple RoR plugin creates better select drop downs that look and feel approximately 25% better!

This URL has Read+Write access

pete (author)
Tue Mar 10 04:55:32 -0700 2009
better_select / README
100644 38 lines (27 sloc) 1.221 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
BetterSelect
============
 
This simple plugin provides some helpers for, guess what?, a better select control. It can be used for any normal select drop down
but has a specialized ability to produce a Time select field. The time select will be a single drop down
with values ranging from 12:00 AM to 12:00 PM to 11:45 PM in steps of 15.(TODO: make the interval configurable)
 
Why is it better you ask?
=========================
It uses prototype/scriptaculous to replace the standard html select with a text input field, so
you have full control over the styling and functionality of the select. Eventually, this
will support autocomplete(TODO)
 
 
Example
=======
 
1. include the js/stylesheets via helper
  better_select_includes
   
    or individually
  
  better_select_javascript_include_tag
  better_select_stylesheet_link_tag
 
2. Use it
  A. generic select
    better_select_tag 'post[author]', options_for_select([["Me", 0],["You", 1])
  B. Time select
    better_time_select_tag 'post[published_at]', @post.published_at
 
Credits
=======
Credits to Gabriel Lanzani (http://www.glanzani.com.ar)
for the js/stylesheets and all around great guy
 
Copyright (c) 2009 [Peter Philips], released under the MIT license