shopping cart
This commit is contained in:
parent
733870ce96
commit
df7585c5e1
11 changed files with 79 additions and 11 deletions
|
@ -24,8 +24,8 @@
|
|||
<%= book.quantity %>
|
||||
</div>
|
||||
<div class='col s2'>
|
||||
<% if logged_in? && book.quantity.positive? %>
|
||||
<%= link_to 'Add', edit_book_path(book), class: "btn" %>
|
||||
<% if logged_in? && book.quantity.positive? && !current_user.books.exists?(book.id) %>
|
||||
<%= link_to 'Add', "book/#{book.id}/add_to_cart", method: :post, class: "btn" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue