A user can chose 5 options. Once they choose one, they can not choose it again. Currently, I simply remove previously used options from the list...so, they can only choose from previously unused ones. The only thing I don't like about this is that as the user is adding a new record to the database, they might wonder why options seem to be missing from the list.
One idea I had was to leave previously used options in the list but cross them out and make them disabled.
Is it possible to disable (and/or add a class) to only certain options in a select? Simple_form seems to have an option_html helper but, didn't see it documented.
Turns out this is quite easy to do. Rails supports it...
<%= f.association :ying, collection: @yangs, :disabled => @used_yangs %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With