Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions app/views/home/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<%= link_to 'New Book', new_book_path %>

<% if @has_books %>
<%= link_to 'My books', books_path %>
<%end%>
<br>

<div class="container-fluid">
<div class="row pr-5 pl-5 mr-2 ml-2">

<% @books.each do |book| %>
<div class="col">

<div class="card mt-5" style="width: 14rem; height: 400px;">
<% if book.image.url != nil %>

<%= image_tag book.image.url , class: "card-img-top", style: "width: 14rem; height: 200px;" %>
<%else%>
<%= image_tag 'https://png.pngtree.com/element_pic/17/07/27/bd157c7c747dc708790aa64b43c3da35.jpg' , class: "card-img-top", style: "width: 14rem; height: 200px;"%>
<%end%>

<div class="card-body">
<h5 class="card-title"><%= link_to book.title, book %></h5>

<p class="card-text"><%= link_to book.description, book %></p>
</div>

</div>
</div>
<% end %>
</div>