Reputation: 902
I want to build a select tag with only specific days for example Mon ... Fri, how can I generate that in rails 2 ?
Upvotes: 0
Views: 112
Reputation: 915
I can't quite believe this is really what you want but
options_for_select(["Mon", "Tue", "Wed", "Thu", "Fri"])
does what you've asked ;)
Upvotes: 5
Reputation: 34774
Maybe use something like calendar date select. You can then indicate that certain dates can be disabled as indicated here. Would look something like:
<%= calendar_date_select_tag "week_day", "",
:valid_date_check => "date.getDay() != 0 && date.getDay() != 6 " %>
Upvotes: 3