I am using RABL for formatting a JSON API response. However, I would like to use that same JSON and render it inline in a different view to use with some JavaScript. Essentially, I'd like to do:
var my_model_data = #{@model.to_json}
...but use the RABL template instead of calling to_json
.
How can I achieve this?