Skip to content

Instantly share code, notes, and snippets.

@toch
Created June 3, 2015 10:04
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 toch/951e2b061ea62d19b33e to your computer and use it in GitHub Desktop.
Save toch/951e2b061ea62d19b33e to your computer and use it in GitHub Desktop.
nested resource and dynamic load
<p id="notice"><%= notice %></p>
<p>
<b>Name:</b>
<%= @post.name %>
</p>
<p>
<b>Title:</b>
<%= @post.title %>
</p>
<p>
<b>Content:</b>
<%= @post.content %>
</p>
<div id="comments"></div>
<script>
$("#comments").load("<%= post_comments_path(@post) %>");
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment