Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
parkinglot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
evilla_gomez_guian_principe
parkinglot
Commits
87e419c3
Commit
87e419c3
authored
Jul 04, 2016
by
Jasmine Principe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated
parent
8782a80e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
89 additions
and
9 deletions
+89
-9
car_logs_controller.rb
draft1/app/controllers/car_logs_controller.rb
+5
-5
create_page.html.erb
draft1/app/views/car_logs/create_page.html.erb
+41
-0
index.html.erb
draft1/app/views/car_logs/index.html.erb
+38
-0
about.html.erb
draft1/app/views/pages/about.html.erb
+1
-1
index.html.erb
draft1/app/views/pages/index.html.erb
+2
-2
routes.rb
draft1/config/routes.rb
+2
-1
No files found.
draft1/app/controllers/car_logs_controller.rb
View file @
87e419c3
...
@@ -3,13 +3,13 @@ class CarLogsController < ApplicationController
...
@@ -3,13 +3,13 @@ class CarLogsController < ApplicationController
def
index
def
index
@records
=
CarLog
.
all
@records
=
CarLog
.
all
if
params
[
:q
].
present?
@records
=
Housemate
.
where
(
plate_number:
params
[
:q
])
end
render
"car_logs/index.html.erb"
render
"car_logs/index.html.erb"
end
end
def
create_page
render
"car_logs/create_page.html.erb"
end
def
create
def
create
record
=
CarLog
.
new
record
=
CarLog
.
new
record
.
plate_number
=
params
[
:plate_number
]
record
.
plate_number
=
params
[
:plate_number
]
...
@@ -19,7 +19,7 @@ class CarLogsController < ApplicationController
...
@@ -19,7 +19,7 @@ class CarLogsController < ApplicationController
record
.
brand
=
params
[
:brand
]
record
.
brand
=
params
[
:brand
]
record
.
save
record
.
save
redirect_to
"car_logs/create.html.erb"
redirect_to
(
"/car_logs"
)
end
end
end
end
\ No newline at end of file
draft1/app/views/car_logs/create_page.html.erb
0 → 100644
View file @
87e419c3
<h1>
Add New Record
</h1>
<%=
form_tag
(
"/car_logs/create"
,
method:
"post"
)
do
%>
<label>
Plate Number
</label>
<input
type=
"text"
name=
"plate_number"
/>
<div></div>
<label>
Time Out:
</label>
<input
type=
"text"
name=
"time_out"
/>
<div></div>
<label>
Color:
</label>
<select
name=
"rate"
class=
"u-full-width"
>
<option
value=
""
disabled=
"disabled"
selected=
"selected"
>
Select..
</option>
<option
value=
"red"
>
red
</option>
<option
value=
"white"
>
white
</option>
<option
value=
"blue"
>
blue
</option>
<option
value=
"green"
>
green
</option>
<option
value=
"orange"
>
orange
</option>
<option
value=
"pink"
>
pink
</option>
<option
value=
"black"
>
black
</option>
<option
value=
"others"
>
others
</option>
</select>
<div></div>
<label>
Brand:
</label>
<select
name=
"rate"
class=
"u-full-width"
>
<option
value=
""
disabled=
"disabled"
selected=
"selected"
>
Select..
</option>
<option
value=
"Honda"
>
Honda
</option>
<option
value=
"Toyota"
>
Toyota
</option>
<option
value=
"Ford"
>
Ford
</option>
<option
value=
"Chevrolet"
>
Chevrolet
</option>
<option
value=
"Audi"
>
Audi
</option>
<option
value=
"Porsche"
>
Porsche
</option>
</select>
<div></div>
<input
type=
"submit"
value=
"Save"
/>
<%
end
%>
<hr>
<a
href=
"/car_logs"
>
Car Logs
</a>
<div></div>
<a
href=
"/"
>
Home
</a>
\ No newline at end of file
draft1/app/views/car_logs/index.html.erb
View file @
87e419c3
<h1>
Car Log Records
</h1>
<%=
form_tag
(
"/car_logs"
,
method:
"get"
)
do
%>
<input
type=
"text"
name=
"q"
>
<input
type=
"submit"
value=
"Search"
>
<%
end
%>
<hr>
<table>
<thead>
<td>
ID
</td>
<td>
Plate Number
</td>
<td>
Time In
</td>
<td>
Time Out
</td>
<td>
Color
</td>
<td>
Brand
</td>
<td
colspan=
"3"
></td>
</thead>
<%
@records
.
each
do
|
record
|
%>
<tr>
<td>
<%=
record
.
id
%>
</td>
<td>
<%=
record
.
plate_number
%>
</td>
<td>
<%=
record
.
time_in
%>
</td>
<td>
<%=
record
.
time_out
%>
</td>
<td>
<%=
record
.
color
%>
</td>
<td>
<%=
record
.
brand
%>
</td>
</tr>
<%
end
%>
</table>
<hr>
<a
href=
"/create_new"
>
Add New Record
</a>
<div></div>
<a
href=
"/"
>
Home
</a>
draft1/app/views/pages/about.html.erb
View file @
87e419c3
...
@@ -4,4 +4,4 @@
...
@@ -4,4 +4,4 @@
<h2>
Guian, April
</h2>
<h2>
Guian, April
</h2>
<h2>
Principe, Jasmine
</h2>
<h2>
Principe, Jasmine
</h2>
<a
href=
"/car_logs"
>
Go to Car Logs
</a>
<a
href=
"/"
>
Home
</a>
\ No newline at end of file
\ No newline at end of file
draft1/app/views/pages/index.html.erb
View file @
87e419c3
<h1>
Parking Lot Logging System
</h1>
<h1>
Parking Lot Logging System
</h1>
<a
href=
"/car_logs"
>
Car Logs
</a>
<a
href=
"about"
>
See member list
</a>
<a
href=
"about"
>
The Developers
</a>
\ No newline at end of file
\ No newline at end of file
draft1/config/routes.rb
View file @
87e419c3
...
@@ -2,5 +2,6 @@ Rails.application.routes.draw do
...
@@ -2,5 +2,6 @@ Rails.application.routes.draw do
root
to:
"pages#index"
root
to:
"pages#index"
get
"/about"
,
to:
"pages#about"
get
"/about"
,
to:
"pages#about"
get
"/car_logs"
,
to:
"car_logs#index"
get
"/car_logs"
,
to:
"car_logs#index"
post
"/create"
,
to:
"car_logs#create"
get
"/create_new"
,
to:
"car_logs#create_page"
post
"/car_logs/create"
,
to:
"car_logs#create"
end
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment