I try to render hash in my rails application to be considering as object in javascript.
div.sort-cartridges data-cartridges-selections=cartridges_selections
where cartridges_selections
is function which return ruby hash.
But if in jQuery + coffee I try to fetch data object I get string:
$ ->
console.log typeof $('.sort-cartridges').data('cartridges-selections')
# => string
I tried to do JSON.parse, but it gave error to me. So, what I need to do?