Last active
August 29, 2015 14:20
-
-
Save yosangwon/98e1c44bc6626f31e5fd to your computer and use it in GitHub Desktop.
Partial Rendering Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p id="notice"><%= notice %></p> | |
<hr/> | |
<%= render partial: "work", collection: @works %> | |
<%= link_to 'Create a New Work', new_work_path %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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