It looks like the author
method expects a string instead of an integer. All you have to do is add to_s
to the item_id for it to work:
<%= link_to @client.author(recco.item_id.to_s).name, book_path(recco.item_id) %>
The reason why the API does not understand the integer you passed to it is likely because they did not logic have in that method to convert that passed argument into a string. Ideally, a public would try and convert whatever args are passed to it into the type of value it expects. The to_s
we did on your method would ideally be in the API, but since you likely don't have control over the API code, you'll have to do the workaround yourself which doesn't take much effort anyway. :)