Skip to content

Commit

Permalink
delete and edit
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyB00y committed Jun 19, 2017
1 parent 217a09a commit b5c5fc6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/views/portfolios/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<h1>Portfolio Items</h1>

<%= link_to "Create New Item", new_portfolio_url %>

<% @portfolio_items.each do |portfolio_item| %>
<p><%= portfolio_item.title %></p>
<p><%= link_to portfolio_item.title, portfolio_path(portfolio_item) %></p>
<p><%= portfolio_item.subtitle %></p>
<p><%= portfolio_item.body %></p>
<%= image_tag portfolio_item.thumb_image unless portfolio_item.thumb_image.nil? %>
<%= link_to "Edit", edit_portfolio_path(portfolio_item) %>
<%= link_to 'Delete Portfolio Item', portfolio_path(portfolio_item), method: :delete, data: { confirm: 'Are you sure?' } %>
<% end %>
7 changes: 7 additions & 0 deletions app/views/portfolios/show.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<%= image_tag @portfolio_item.main_image %>

<h1><%= @portfolio_item.title %></h1>

<em><%= @portfolio_item.subtitle %></em>

<p><%= @portfolio_item.body %></p>

0 comments on commit b5c5fc6

Please sign in to comment.