rails remote form
$("#wall_add").html("<%= escape_javascript( render(:partial => "walls/form") ) %>");
display me
<form accept-charset="UTF-8" action="/walls" class="new_wall" id="new_wall" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="9QBC/0uUIH2xJdZBcvTZb9开发者_如何学GoNsm1kL2hFipQq6NUdmCzU=" /></div> <div class="field"> <label for="wall_content">Content</label><br /> <textarea cols="40" id="wall_content" name="wall[content]" rows="20"></textarea> </div> <div class="actions"> <input name="commit" type="submit" value="Create Wall" /> </div> <input id="recipient" name="recipient" type="hidden" value="2" /> </form>
as text but not as html elements, http://deeflow.com/changer/remote.png
You need to call html_safe
$("#wall_add").html("<%= escape_javascript( render(:partial => "walls/form").html_safe ) %>");
精彩评论