Topic: If Else Statement in Views
I want to simulate the way craigslist displays the date of submissions.
I want to display submission date for the entries, but I don't want to see duplicates of the submission date.
My pseudocode goes something like this, but not sure how to implement it.
In view file,
<% @submissions.each do |submission| %> #while loop going through all the submissions
If previous_submission_date != current_submission_time
}
Display current_submission_date
previous_submission_date = current_submission_time
}
<% end %>