Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MIS21MidtermsParkingLot
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
Dean Krisitan Bardeloza
MIS21MidtermsParkingLot
Commits
59dbbc58
Commit
59dbbc58
authored
Jul 05, 2016
by
Bianca Tarun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added add method, index method, add.html.erb and /carlog/index.html.erb
parent
80306559
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
109 additions
and
1 deletion
+109
-1
car_logs_controller.rb
parkinglot/app/controllers/car_logs_controller.rb
+19
-1
add.html.erb
parkinglot/app/views/carlog/add.html.erb
+40
-0
index.html.erb
parkinglot/app/views/carlog/index.html.erb
+50
-0
No files found.
parkinglot/app/controllers/car_logs_controller.rb
View file @
59dbbc58
class
CarLogController
<
ApplicationController
class
CarLogController
<
ApplicationController
\ No newline at end of file
def
index
@car_logs
=
Carlog
.
all
render
"/car_log/index.html.erb"
end
def
add
car
=
CarLog
.
new
car
.
plate_number
=
params
[
:plate_number
]
car
.
time_in
=
params
[
:time_in
]
car
.
time_out
=
params
[
:time_out
]
car
.
color
=
params
[
:color
]
car
.
brand
=
params
[
:brand
]
car
.
save
end
end
\ No newline at end of file
parkinglot/app/views/carlog/add.html.erb
0 → 100644
View file @
59dbbc58
<h1>
Add Car
</h1>
<%=
form_tag
(
"/car_log/add"
,
method:
"post"
)
do
%>
<label>
Plate Number:
</label>
<input
type=
"text"
name=
"plate_number"
/>
<hr>
<label>
Time In:
</label>
<input
type=
"datetime"
name=
"time_in"
/>
<hr>
<label>
Time Out:
</label>
<input
type=
"datetime"
name=
"time_out"
/>
<hr>
<label>
Color:
</label>
<select
name=
"color"
>
<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>
<hr>
<label>
Brand:
</label>
<select
name=
"brand"
>
<option
value =
"Honda"
>
Honda
</option>
<option
value =
"Toyota"
>
Toyota
</option>
<option
value =
"Ford"
>
Ford
</option>
<option
value =
"Suzuki"
>
Suzuki
</option>
<option
value =
"Chevrolet"
>
Chevrolet
</option>
<option
value =
"Mitsubishi"
>
Mitsubishi
</option>
<option
value =
"Subaru"
>
Subaru
</option>
<option
value =
"Nissan"
>
Nissan
</option>
<option
value =
"Others"
>
Others
</option>
</select>
<hr>
<input
type=
"submit"
value=
"Add Car"
/>
<%
end
%>
<hr>
<a
href=
"/car_log"
>
View All Cars
</a>
\ No newline at end of file
parkinglot/app/views/carlog/index.html.erb
0 → 100644
View file @
59dbbc58
<table>
<thead>
<tr>
<th>
Plate Number
</th>
<th></th>
<th></th>
<th></th>
<th>
Time In
</th>
<th></th>
<th></th>
<th></th>
<th>
Time Out
</th>
<th></th>
<th></th>
<th></th>
<th>
Color
</th>
<th></th>
<th></th>
<th></th>
<th>
Brand
</th>
</tr>
</thead>
<tbody>
<%
@car_logs
.
each
do
|
car
|
%>
<tr>
<td>
<%=
car
.
plate_number
%>
</td>
<td></td>
<td></td>
<td></td>
<td>
<%=
car
.
time_in
%>
</td>
<td></td>
<td></td>
<td></td>
<td>
<%=
car
.
time_out
%>
</td>
<td></td>
<td></td>
<td></td>
<td>
<%=
car
.
color
%>
</td>
<td></td>
<td></td>
<td></td>
<td>
<%=
car
.
brand
%>
</td>
</tr>
<%
end
%>
</tbody>
</table>
<hr>
<a
href=
"/car_log/add"
>
Add New Sport
</a>
<hr>
<a
href=
"/"
>
Go back to Homepage
</a>
\ 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