Code is in pastie.
Put the "helper" section code in your helper file:
For usage, put the code in the "usage" section in your rhtml.
Notes:
* selected_value will only work with integers! It's possible this'll be changed in the future.
[EDIT]
2007-01-03: I changed the pastie code so an error won't be generated even if selected_value is nil
[EDIT]
2007-01-07: If the collection passed is empty, 2 things happen:
- The first option with value 0 is "Empty list"
- The list is disabled.
No comments:
Post a Comment