I have two content types, articles and events. I want to create a partial on my homepage to serve an array of both.
I was thinking of creating a helper method called latest_news, something like this
def latest_news(limit=12)
@articles = Article.all
@events = Event.all
sort_by(&:created_at)
end
Also, how would I sort the articles by their publish_date and the events by their event_date?