Skip to content

Instantly share code, notes, and snippets.

@AnkurVyas-BTC
Created July 24, 2016 07:47
Show Gist options
  • Save AnkurVyas-BTC/2b5e33b0d77e4b2fc26e93ae3c956415 to your computer and use it in GitHub Desktop.
Save AnkurVyas-BTC/2b5e33b0d77e4b2fc26e93ae3c956415 to your computer and use it in GitHub Desktop.
The view part to display the messages.
<h1>Messages</h1>
<!-- Todays messages -->
<% if @grouped_messages.present? && @grouped_messages[true].present? %>
<h3> Today </h3>
<% @grouped_messages[true].each do |msg| %>
<%= msg.content %>
<%= msg.created_at.strftime('%I:%M %p') %>
<br />
<% end %>
<br />
<% end %>
<!-- Month wise grouped messages -->
<% if @month_wise_sorted_alerts.present? %>
<% @month_wise_sorted_alerts.each do |hash_elements|%>
<h3> <%= Date::MONTHNAMES[hash_elements.first] %> </h3>
<% hash_elements.last.each do |msg| %>
<%= msg.content %>
<%= msg.created_at.strftime('%b %d') %>
<br />
<% end %>
<br />
<% end %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment