From a93daad4f5e92e10af5f7b28e5cd515b741e0ef9 Mon Sep 17 00:00:00 2001 From: badraih Date: Tue, 12 Mar 2019 18:48:01 +0300 Subject: [PATCH] added bootstrap --- app/views/home/index.html.erb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 app/views/home/index.html.erb 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