Created
April 20, 2014 22:08
-
-
Save catm705/11126493 to your computer and use it in GitHub Desktop.
link_to
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
<!-- views/picture/index.html.erb --> | |
<% if flash[:msg] %> | |
<%= flash[:msg] %> | |
<% end %> | |
<br> | |
<%= link_to "create picture", new_picture_path(@picture) %> | |
<br> | |
<br> | |
<% @pictures.each do |picture| %> | |
<img src="<%= picture.image_url %>" alt="" width="300px"/> | |
<p><strong><%= picture.description %> </strong></p> | |
<%= link_to "show picture", picture_path(picture) %> | |
<br> | |
<%= link_to "edit picture", edit_picture_path(picture)%> | |
<br> | |
<%= link_to "Delete", picture_path(picture), method: :delete %> | |
<br> | |
<%= link_to "delete picture", { action: :destroy, id: picture.id}, method: :delete %> | |
<br> | |
<br> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment