I think, ApplicationController.render should return data in json format when it works with jbuilder templates. Right now it returns a string.
There is a similar problem and expectation from SO user:
http://stackoverflow.com/questions/39103685/can-you-invoke-jbuilder-to-create-a-native-rails-object-instead-of-a-rendered-st
Right now I solved it with simple helpers, like this:
module ChannelHelper
def render_view(params)
ApplicationController.render(params)
end
def render_json(params)
JSON.parse render_view(params)
end
def broadcast channel, message
ActionCable.server.broadcast channel, message
end
end
https://github.com/DeployRB/Rails5App/blob/master/app/channels/notes_channel.rb#L18