I'm able to display the votes user likes, but I don't know how to display the actual record of the liked record. Whats the simplest way to retrieve user voted records?
controller.rb
def show
@user = User.find(params[:id])
@liked = @user.votes
end
show.html.haml
= @liked.to_json
Result:
[{"id":5,"votable_id":8,"votable_type":"Post","voter_id":2,"voter_type":"User","vote_flag":true,"vote_scope":null,"vote_weight":1,"created_at":"2016-02-01T00:33:15.968Z","updated_at":"2016-02-01T00:33:15.968Z"}]
How do I turn this so I can just display the title, description, etc... from the Post record?