Skip to content

Commit

Permalink
Merge pull request #79 from sparta-201803/feature/issues/#78
Browse files Browse the repository at this point in the history
products showでサインインしていないと表示できない問題を修正
  • Loading branch information
noopy0415 authored Apr 25, 2018
2 parents 89f414a + b5539d3 commit 1818d26
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/views/products/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@
product_name: @product.name, product_price: @product.price,
product_volume: 1, product_id: @product.id}
), class: "btn btn-default" %>
<% if current_user.id == @product.user_id || current_user.id == 1 %>
<%= button_to "編集", edit_product_path, method: :get, class: "btn btn-default" %>
<% end %>
<% else %>
<%= button_to "購入", buy_product_path(@product), disabled: true, class: "btn btn-default" %>
<% end %>
<% if current_user %>
<% if current_user.id == @product.user_id || current_user.id == 1 %>
<%= button_to "編集", edit_product_path, method: :get, class: "btn btn-default" %>
<% end %>
<% end %>
</div>
</div>

0 comments on commit 1818d26

Please sign in to comment.