Skip to content

Instantly share code, notes, and snippets.

@aalvesjr
Created December 4, 2012 16:20
Show Gist options
  • Save aalvesjr/4205749 to your computer and use it in GitHub Desktop.
Save aalvesjr/4205749 to your computer and use it in GitHub Desktop.
Trocar essa coisa feia na view!! #Rails
<!-- Atual -->
<td width="14%">
<span>
<%= i.date_select :expiration_date, {:order =>[:day, :month, :year], :default => Time.now + (60*60*24*30*number)}, {:class => 'select' } %>
</span>
</td>
<!-- Alterar para: -->
<td width="14%">
<span>
<%= i.date_select :expiration_date, {:default => Time.now + number.months}, {:class => 'select' } %>
</span>
</td>
<!-- app/views/receipts/create.html.erb -->
<!-- app/views/payments/create.html.erb -->
<% Time.now + 5.days + 7.hours + 3.minutes + 14.seconds # só por curiosidade ;) %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment