Created
February 18, 2012 01:22
-
-
Save dLobatog/1856734 to your computer and use it in GitHub Desktop.
Bad code
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
<% people = Person.find( | |
:conditions => ["added_at > ? and deleted = ?", Time.now.utc, false], | |
:order => "last_name, first_name") %> | |
<% people.reject { |p| p.address.nil? }.each do |person| %> | |
<div id="person-<%= person.new_record? ? "new" : person.id %>"> | |
<span class="name"> | |
<%= person.last_name %>, <%= person.first_name %> | |
</span> | |
<span class="age"> | |
<%= (Date.today - person.birthdate) / 365 %> | |
</span> | |
</div> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment