Seems like you're returning an String, but "blog_posts" is defined as a Hash (see line 96). It's confusing. If the method tries to return an String, blog_posts must be an string.