• Download Gist
app/views/examples/_example_partial_without_nested_insert_html.rhtml
RHTML
1
<%= link_to_function "A link_to_function without insert_html", nil %>
app/views/examples/index.rhtml
RHTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<p>
<%= link_to_function "A nested link to insert a partial without a nested insert_html" do |page|
page.insert_html :top, :without_a_nested_insert_html, :partial => 'example_partial_without_nested_insert_html'
end %>
</p>
<div id="without_a_nested_insert_html">
</div>
 
<p>
<%= link_to_function "A link to insert a partial with nested insert_html" do |page|
page.insert_html :top, :with_a_nested_insert_html, :partial => 'example_partial_with_nested_insert_html'
end %>
</p>
 
<div id="with_a_nested_insert_html">
</div>
app/views/layouts/example.rhtml
RHTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>People: <%= controller.action_name %></title>
<%= javascript_include_tag :defaults %>
</head>
<body>
 
<p style="color: green"><%= flash[:notice] %></p>
 
<%= yield %>
 
</body>
</html>
apps/views/examples/_example_partial_with_nested_insert_html.rhtml
RHTML
1 2 3
<%= link_to_function "A nested link to insert_html" do |page|
page.insert_html :top, :with_a_nested_insert_html, :partial => 'you_wont_see_this'
end %>
apps/views/examples/_you_wont_see_this.rhtml
RHTML
1
You'll never see this page.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.