I'm currently trying to return multiple JSON objects in one of my controllers as such.
@chromosomes = @organism.chromosomes.to_json
@file_data = current_user.files.to_json
respond_to do |format|
format.html
end
However, on the front end when I do:
<%= @chromosomes %>
or
<%= @file_data %>
I don't get a JSON object, instead I get the data as a string with things such as "e, etc. I've tried parsing the string such as
console.log($.parseJSON("<%= @chromosomes %>"));
but it still isn't working. Is this is because the request being sent back is html?
Thanks!