Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agreycrane/235729 to your computer and use it in GitHub Desktop.
Save agreycrane/235729 to your computer and use it in GitHub Desktop.
<%= 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 %>
<%= link_to_function "A link_to_function without insert_html", nil %>
You'll never see this page.
<!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>
<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment