Answer the question
In order to leave comments, you need to log in
How to show a block from a handler in Rails using ajax ???
For example, we were able to send data through js and get a block like this:
$('.block').load('/view',data);
And in the handler file in php, we could send the html content like this:
echo "
<div>
Содержимое Содержимое СодержимоеСодержимое
Содержимое
Содержимое
</div>";
Answer the question
In order to leave comments, you need to log in
You can text, you can partial, you can json, xml, pdf, file ...
In general, you can render what you need, what's the problem?
If you want, render one layout, if you want - everything, but without a layout, with an alternative layout.
You can do respond_with(@resource) and render in the format that the request came in.
Lots of possibilities
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question