У меня есть этот помощник, который показывает месяцы и годы из модели событий в выбранном входе. Как я показываю только текущие и будущие месяцы, а не прошедшие месяцы?
def select_month_tag(events)
html = <<-HTML
<select id="filtro-mes-ano" class="event-filter selectCustom2 event_filter_select">
<option value="Filtrar por mês" disabled selected >Filtrar por mês</option>
HTML
events.each do | event |
if not date_and_month(event.month_ref, event.year_ref).blank?
html += <<-HTML
<option data-year="#{event.year_ref}"
data-month="#{event.month_ref}"
"#{'selected' if is_hash_selected?(event)}">
date_and_month(event.month_ref, event.year_ref)}
</option>
HTML
end
end
html += <<-HTML
</select>
HTML
html.html_safe
end
Спасибо.