I'm new to Ruby on Rails, and I'm trying to figure out how to combine queries into an array, arrange them in order so they can output based on time.
In my controller I have this:
@tag_media_items = client.tag_recent_media('cats')
@location_media_items = client.location_recent_media('412421')
In my views I have this:
<% @tag_media_items.each do |media| %>
<img src="<%= media.images.thumbnail.url%>">
<% end%>
<% @location_media_items.each do |media| %>
<img src="<%= media.images.thumbnail.url%>">
<% end%>
I can also figure out the time that it was created by this:
<%= media.created_time %>
on each of the loop.
Now I'm learning how to put the loop into an array and then arrange it based on created_item? Is there a simple syntax for this?
Thanks!