GitXplorerGitXplorer
t

option_tags_will_disable

public
3 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
af5c48279fe04e1d6de6c490e0638bd48836f86a

Updated README

ttekin committed 16 years ago
Unverified
0bd365f2f1e3b207b870c49ac677be1933316d43

Updated to allow a Proc to be used to identify disabled and selected options from a collection and increased test coverage

ttekin committed 16 years ago
Unverified
3ec73c98526c1d24124bfc9423260fb312183ffc

Had InstanceTag class one level too deep!

ttekin committed 16 years ago
Unverified
cd41e92917d1ca4fb7746fa2d0a26fa51cc58a47

Renamed files and removed unnecessary tasks folder

ttekin committed 16 years ago
Unverified
8bccaf133e6b9e6741fd850aadc3ed60630ed462

Initial commit

ttekin committed 16 years ago

README

The README file for this repository.

=OptionTagsWithDisabled

Enhancements to form option tag helpers.

==Disabled option tags

Disabled option tags can now be specified:

<%= options_for_select(['Please choose a size', 'small', 'medium', 'large'], nil, 'medium' ) %>

Gives you:

<option value="Please choose a size">Please choose a size</option>
<option value="s">small</option>
<option value="m" disabled="disabled">medium</option>
<option value="l">large</option>

You can specify a single value or an array of disabled values.

==Proc for selected and disabled option tags

options_from_collection_for_select now accepts a proc to identify selected and/or disabled attributes:

options_from_collection_for_select(@products, :id, :name, nil, lambda{|p| p.in_stock? })

Would produce:

small medium large extra large

Where any elements of the collection that are out of stock would be disabled.

Copyright (c) 2008 Tekin Suleyman, released under the MIT license