Displaying 1 result from an estimated 1 matches for "topicopt".
Did you mean:
epicopt
2009 Jun 03
3
Appending a Rails Partial with jQuery
...document).ready(function() {
$(''#add_option'').click(function() {
$(this).addPollOption();
});
});
jQuery.fn.addPollOption = function() {
$("#poll_options").append(''#{escape_javascript render(:partial =>
"topics/poll_option", :object => TopicOption.new)}'');
};
i have tried it with the #{} and the <%= %> both give the same result.
Instead of getting the partial to populate the div, it simply adds the
text to the div below the 2 existing form fields.
#{escape_javascript render(:partial => "topics/poll_option",...