I have a controller with 3 hashes I want to combine into 1 object to pass to a view.
@feedorders = current_user.orders.order("created_at DESC")
@feedcustomers = current_user.customers.order("created_at DESC")
@feedbooks = current_user.books.order("created_at DESC")
How should I go back doing this?
Then you can get the orders with
Edit:
If you just want to get one array and do not care that the different kind of objects go mixed, then you could just do
It just may be a bit more difficulty to work with such an array in the view.