Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
parkinglot_141392_145028
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
Donna Dumaliang
parkinglot_141392_145028
Commits
d342d591
Commit
d342d591
authored
Jul 05, 2016
by
Donna Dumaliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
done
parent
cc4f3cfc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
car_logs_controller.rb
app/controllers/car_logs_controller.rb
+8
-1
newCarLog.html.erb
app/views/car_logs/newCarLog.html.erb
+12
-5
No files found.
app/controllers/car_logs_controller.rb
View file @
d342d591
...
...
@@ -3,6 +3,12 @@ class CarLogsController < ApplicationController
@CarLogs
=
CarLog
.
all
.
paginate
(
:page
=>
params
[
:page
],
:per_page
=>
8
)
end
def
deletestudent
id
=
params
[
:id
]
@CarLogs
=
CarLog
.
find
(
id
.
to_i
)
@CarLogs
.
destroy
redirect_to
'/'
end
def
addCarLog
...
...
@@ -12,13 +18,14 @@ class CarLogsController < ApplicationController
plate_number
=
params
[
:inputPlateNumber
]
brand
=
params
[
:inputBrand
]
slot_number
=
params
[
:inputSlotNumber
]
is_taken
=
params
[
:is_taken
]
if
!
plate_number
.
empty?
&&
!
brand
.
empty?
newCarlog
=
CarLog
.
new
newCarlog
.
plate_number
=
plate_number
newCarlog
.
brand
=
brand
newCarlog
.
slot_number
=
slot_number
newCarlog
.
is_taken
=
true
newCarlog
.
is_taken
=
is_taken
newCarlog
.
save
...
...
app/views/car_logs/newCarLog.html.erb
View file @
d342d591
<div
class=
"container"
>
<form
class=
"form-signin"
>
<h2
class=
"form-signin-heading"
>
Please sign in
</h2>
<label
for=
"inputEmail"
class=
"sr-only"
>
Email address
</label>
<input
type=
"email"
id=
"inputEmail"
class=
"form-control"
placeholder=
"Email address"
required
autofocus
>
<label
for=
"inputPassword"
class=
"sr-only"
>
Password
</label>
<input
type=
"password"
id=
"inputPassword"
class=
"form-control"
placeholder=
"Password"
required
>
<h2
class=
"form-signin-heading"
>
Please Fill Up
</h2>
<label
for=
"inputPlateNumber"
class=
"sr-only"
>
Plate number
</label>
<input
type=
"text"
id=
"inputPlateNumber"
class=
"form-control"
placeholder=
"Plate Number"
required
autofocus
>
<label
for=
"inputBrand"
class=
"sr-only"
>
Brand
</label>
<select
name=
"cars"
id=
"inputBrand"
class=
"form-control"
placeholder=
"Brand"
>
<option
value=
"volvo"
>
Honda
</option>
<option
value=
"saab"
>
Toyota
</option>
<option
value=
"fiat"
>
Ford
</option>
</select>
<label
for=
"is_taken"
class=
"sr-only"
>
Is taken?
</label>
<input
type=
"radio"
name=
"is_taken"
value=
"yes"
checked
>
Yes
<br>
<input
type=
"radio"
name=
"gender"
value=
"no"
>
No
<br>
<div
class=
"checkbox"
>
<label>
<input
type=
"checkbox"
value=
"remember-me"
>
Remember me
...
...
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