Commit 31ea132c authored by Kristoff Sison's avatar Kristoff Sison

added show all page and back button

parent 4506e773
...@@ -166,4 +166,4 @@ DEPENDENCIES ...@@ -166,4 +166,4 @@ DEPENDENCIES
web-console (~> 2.0) web-console (~> 2.0)
BUNDLED WITH BUNDLED WITH
1.10.6 1.12.5
...@@ -23,4 +23,8 @@ class CarLogsController < ApplicationController ...@@ -23,4 +23,8 @@ class CarLogsController < ApplicationController
@car.destroy @car.destroy
redirect_to "/carlogs" redirect_to "/carlogs"
end end
def show
@cars = CarLog.all
render "carlogs/show.html.erb"
end
end end
\ No newline at end of file
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
<a id="plus" href="/carlogs/new" class="card"> <a id="plus" href="/carlogs/new" class="card">
Add More Add More
</a> </a>
<a id="plus" href="/carlogs/show" class="card">
Show All
</a>
</div> </div>
\ No newline at end of file
<nav>
<a href="/" class="logo">
<div style="font-size:50px; font-weight: bold; color:white; text-align: center;">
Park <div style="display:inline; color:black; background:#fe9900; border-radius:5px; font-size:50px; padding:1px 5px;">hub</div>
</a>
</nav>
<div class="card-container">
<% @cars.each do |car|%>
<div class="card">
<div class="column orange">
<label>Brand</label><%=car.brand=%>
<label>Plate Number</label><%=car.plate_number=%>
<label>Color</label><%=car.color=%>
</div>
<div class="column">
<label>Created</label> <%=car.created_at=%>
<br>
<label>Time In</label><%=car.time_in=%>
<label>Time Out</label><%=car.time_out=%>
</div>
</div>
<%end%>
<a id="plus" href="/carlogs/index" class="card">
Back
</a>
</div>
\ No newline at end of file
...@@ -3,7 +3,9 @@ Rails.application.routes.draw do ...@@ -3,7 +3,9 @@ Rails.application.routes.draw do
get "/carlogs", to: "car_logs#index" get "/carlogs", to: "car_logs#index"
get "/group", to: "pages#group" get "/group", to: "pages#group"
get "/carlogs/new", to: "car_logs#form" get "/carlogs/new", to: "car_logs#form"
get "/carlogs/show", to: "car_logs#show"
post "/carlogs/create", to: "car_logs#create" post "/carlogs/create", to: "car_logs#create"
get "/carlogs/index", to: "car_logs#index"
get "carlogs/delete/:id", to: "car_logs#delete" get "carlogs/delete/:id", to: "car_logs#delete"
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment