You can use render_to_string
to render your RABL template into a string, and then deal with it from there. For instance you could parse it back to JSON and then manipulate it or embed it in a bigger JSON structure. Then you can use render
to respond directly with your new data.
I just tested this in my app
def index
@galleries = Gallery.all # or whatever
respond_with_datatable
end
def respond_with_datatable
template_json = JSON(render_to_string)
json = {:new_data => "some new stuff", :orig_data => template_json}
render :json => json
end