diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb new file mode 100644 index 0000000..c3fd411 --- /dev/null +++ b/app/views/home/index.html.erb @@ -0,0 +1,31 @@ +<%= link_to 'New Book', new_book_path %> + +<% if @has_books %> +<%= link_to 'My books', books_path %> +<%end%> +
+ +
+
+ +<% @books.each do |book| %> +
+ +
+<% 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%> + +
+
<%= link_to book.title, book %>
+ +

<%= link_to book.description, book %>

+
+ +
+
+<% end %> +
\ No newline at end of file