Created
March 18, 2009 22:41
-
-
Save tekin/81456 to your computer and use it in GitHub Desktop.
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
<%= options_from_collection_for_select(@product.sizes, :name, :id, :disabled => lambda{|size| size.out_of_stock?}) %> | |
<!-- If small and medium returned true for the method out_of_stock?, you’d get something like: --> | |
<option value=“23“ disabled=“disabled“>small</option> | |
<option value=“24“ disabled=“disabled“>medium</option> | |
<option value=“25“>large</option> | |
<option value=“26“>extra large</option> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment