Skip to content

Instantly share code, notes, and snippets.

@yosangwon
Last active August 29, 2015 14:20
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save yosangwon/98e1c44bc6626f31e5fd to your computer and use it in GitHub Desktop.
Partial Rendering Example
<div id="workca">
<strong><%= link_to work.owner, work.owner.name %></strong>
<%= link_to "#{time_ago_in_words(work.created_at)} ago", work %>
<%= link_to 'Edit', edit_work_path(work) %>
<%= link_to 'Destroy', work, method: :delete, data: { confirm: 'Are you sure?' } %><br/>
<h2><%= work.name %></h2>
<hr/>
</div>
<p id="notice"><%= notice %></p>
<hr/>
<%= render partial: "work", collection: @works %>
<%= link_to 'Create a New Work', new_work_path %>
<p id="notice"><%= notice %></p>
<%= render partial: 'show', locals: { work: @work } %>
<%= link_to 'Edit', edit_work_path(@work) %> |
<%= link_to 'Back', works_path %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment