I have a ajax call, and I want to return a json response.
The controller will need to get the output of a partial, plus add some other properties to the object then serialize to json.
How can I get the output of a partial and store it to this object?
I want something like:
def my_action
my_output.html = render :partial => 'test', ....
my_output.some_prop1 = 234234
my_output.to_json
end
Then in my view I will inject the html into the DOM, etc.
Just use
render_to_stringin place ofrender.