I have 2 tables Posts & Websites. I have a single feed where I want to display posts and websites together in chronological order.
How can I do that? Currently, I pull separately
Posts.all in posts_controller
and
Websites.all in websites_controller
Thank you!
@feed = (@posts + @websites).sort_by {|a| a.created_at}.reverse
this simple line solved it!