Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F905143
jobs_controller.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Aug 29, 9:30 PM
Size
868 B
Mime Type
text/x-ruby
Expires
Sun, Aug 31, 9:30 PM (9 h, 32 m)
Engine
blob
Format
Raw Data
Handle
252500
Attached To
rWEBDNS WebDNS (edet4)
jobs_controller.rb
View Options
module
Admin
class
JobsController
<
ApplicationController
before_action
:authenticate_user!
before_action
:admin_only!
before_action
:job
,
only
:
[
:destroy
,
:update
]
# GET /jobs
def
index
@job_categories
=
{
'Pending'
=>
Job
.
includes
(
:domain
)
.
pending
,
'Completed'
=>
Job
.
includes
(
:domain
)
.
completed
.
order
(
'id desc'
)
}
end
# DELETE /jobs/1
def
destroy
@job
.
destroy
redirect_to
admin_jobs_url
,
notice
:
"
#{
@job
.
id
}
was successfully destroyed."
end
# PUT /jobs/1
def
update
if
@job
.
update
(
job_params
)
redirect_to
admin_jobs_url
,
notice
:
'Job was successfully updated.'
else
render
:edit
end
end
private
def
job
@job
=
Job
.
find
(
params
[
:id
]
)
end
def
job_params
params
.
require
(
:job
)
.
permit
(
:status
)
end
end
end
Event Timeline
Log In to Comment