# Nested insert\_html question

**URL:** <https://www.ruby-forum.com/t/nested-insert-html-question/104004>\
**Category:** Rails\
**Created:** [May 12, 2007, 7:48pm UTC](https://www.ruby-forum.com/t/nested-insert-html-question/104004 "2007-05-12T19:48:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jack.tang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8797f3/32.png) [@jack.tang](https://www.ruby-forum.com/u/jack.tang)\
**Post date:** [May 12, 2007, 7:48pm UTC](https://www.ruby-forum.com/t/nested-insert-html-question/104004/1 "2007-05-12T19:48:11Z")

</div>

Hi

I am now facing one odd question. Here is the example.

one page, say foo.rhtml, I try to load partial content when user click  
“Load” button, so the code is

# foo.rhtml

# 

\<%=link\_to\_function “Load”, do |page|  
page.insert\_html :bottom, ‘current-entry’, :partial =\>  
‘foo\_part’, :object =\> foo\_obj  
end %\>

In partial \_foo\_part, there are some actions, say “Send email” and  
here is my code

# \_foo\_part.rhtml

# 

\<%=link\_to\_function “Send mail” do |page|  
page.insert\_html :after, “actionrow”, ‘

- blabla
’  
end%\>

However, the generated javascript code seems wrong, in firefox (with  
firbug extension) some errors come out:

missing ) after argument list  
[Break on this error] ef="#" onclick="try {\nnew  
Insertion.After(“actionrow”, “

- Last item
”)…

Please help me. The question has blocked me for 2 days. Thanks very  
much

/Jack

---

<div class="post-metadata">

**Author:** ![jack.tang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8797f3/32.png) [@jack.tang](https://www.ruby-forum.com/u/jack.tang)\
**Post date:** [May 12, 2007, 8:13pm UTC](https://www.ruby-forum.com/t/nested-insert-html-question/104004/2 "2007-05-12T20:13:14Z")

</div>

Here is even more sample to re-produce the bug

\<%=link\_to\_function “Load”, do |page|

page.insert\_html :bottom, ‘current-item’, (link\_to\_function(“Test”) do  
|page| page.alert(‘test’) end)

end %\>
