I'm creating an app in Rails that uses ActionCable/Websockets and I'm using coffeescript to update a users browser with data received from the current channel in ActionCable. When I run this code I get the error "Uncaught TypeError: data.user.name is not a function", however when I swap data.user.id and data.user.name the error is then for data.user.id. I think my syntax is wrong but I can't find any answers. Any help would be appreciated. Thanks
received: (data) ->
$('#players-table').show()
$('#players-table-body').append '<tr>' +
'<td>' + data.user.id + '</td>' +
'<td>' + data.user.name +'</td>'