Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
Datababes
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
George Nicole Balmaceda
Datababes
Commits
e01cb97a
Commit
e01cb97a
authored
Jul 05, 2016
by
royce-matthew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added add forms functionality
parent
ed9e3f43
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
car_logs_controller.rb
parkinglot/app/controllers/car_logs_controller.rb
+10
-0
routes.rb
parkinglot/config/routes.rb
+1
-0
No files found.
parkinglot/app/controllers/car_logs_controller.rb
View file @
e01cb97a
...
...
@@ -7,4 +7,14 @@ class CarLogsController < ApplicationController
@cars
=
CarLog
.
all
render
"carlogs/form.html.erb"
end
def
create
x
=
CarLog
.
new
x
.
plate_number
=
params
[
:plate_number
]
x
.
color
=
params
[
:color
]
x
.
brand
=
params
[
:brand
]
x
.
time_in
=
"
#{
params
[
:date_in
]
}
#{
params
[
:time_in
]
}
"
x
.
time_out
=
"
#{
params
[
:date_out
]
}
#{
params
[
:time_out
]
}
"
x
.
save
redirect_to
"/carlogs"
end
end
\ No newline at end of file
parkinglot/config/routes.rb
View file @
e01cb97a
...
...
@@ -3,6 +3,7 @@ Rails.application.routes.draw do
get
"/carlogs"
,
to:
"car_logs#index"
get
"/group"
,
to:
"pages#group"
get
"/carlogs/new"
,
to:
"car_logs#form"
post
"/carlogs/create"
,
to:
"car_logs#create"
end
...
...
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