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
f29f6e6f
Commit
f29f6e6f
authored
Jul 05, 2016
by
Jasmine Principe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updateddeletebutton
parent
b0b2c663
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
3 deletions
+11
-3
Gemfile.lock
draft3/Gemfile.lock
+3
-0
car_logs_controller.rb
draft3/app/controllers/car_logs_controller.rb
+5
-3
index.html.erb
draft3/app/views/car_logs/index.html.erb
+2
-0
routes.rb
draft3/config/routes.rb
+1
-0
No files found.
draft3/Gemfile.lock
View file @
f29f6e6f
...
...
@@ -159,3 +159,6 @@ DEPENDENCIES
tzinfo-data
uglifier (>= 1.3.0)
web-console (~> 2.0)
BUNDLED WITH
1.10.4
draft3/app/controllers/car_logs_controller.rb
View file @
f29f6e6f
...
...
@@ -28,9 +28,11 @@ class CarLogsController < ApplicationController
def
delete
car_log_to_delete
=
CarLog
.
find
(
record
.
id
)
car_log_to_delete
.
destroy!
id
=
params
[
:id
]
@records
=
CarLog
.
find
(
id
.
to_i
)
@records
.
destroy
redirect_to
(
"/car_logs"
)
end
end
\ No newline at end of file
draft3/app/views/car_logs/index.html.erb
View file @
f29f6e6f
...
...
@@ -16,6 +16,7 @@
<th>
Time Out
</th>
<th>
Color
</th>
<th>
Brand
</th>
<th>
</th>
</tr>
<%
@records
.
each
do
|
record
|
%>
...
...
@@ -26,6 +27,7 @@
<td>
<%=
record
.
time_out
%>
</td>
<td>
<%=
record
.
color
%>
</td>
<td>
<%=
record
.
brand
%>
</td>
<td><a
href=
"car_logs/delete/
<%=
record
.
id
%>
"
>
Delete
</a></td>
</tr>
<%
end
%>
</table>
...
...
draft3/config/routes.rb
View file @
f29f6e6f
...
...
@@ -4,5 +4,6 @@ Rails.application.routes.draw do
get
"/car_logs"
,
to:
"car_logs#index"
get
"/create_new"
,
to:
"car_logs#create_page"
post
"/car_logs/create"
,
to:
"car_logs#create"
get
"/car_logs/delete/:id"
,
to:
"car_logs#delete"
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