Struggling a bit with rendering a partial in an RJS template. I’m having
to feed the javascript directly to the page object as couldn’t find a
way to have insert_html work directly on the proxy object returned by
select.
However, that’s not the problem. The code for doing that is below and it
all works fine, except that a new line is being inserted after the
partial and before the final single quote, which means the string isn’t
terminated. It’s definitely not in the partial, which is a simple
one-line:
page << “first_item = $$(’#rant_list li’).first(); new Insertion.Before
first_item, ‘#{render(:partial => ‘rant_list_item’, :object =>
@rant)}’;”
Anybody got any ideas why it’s doing this?