Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F887934
schedules_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
Sun, Aug 10, 7:33 AM
Size
951 B
Mime Type
text/x-ruby
Expires
Tue, Aug 12, 7:33 AM (17 h, 21 m)
Engine
blob
Format
Raw Data
Handle
246434
Attached To
rARCHIVING archiving
schedules_controller.rb
View Options
class
SchedulesController
<
ApplicationController
before_action
:fetch_host
,
only
:
[
:new
,
:create
]
before_action
:fetch_job_id
,
only
:
[
:new
,
:create
]
def
new
@schedule
=
@host
.
schedules
.
new
end
def
show
end
def
edit
end
def
update
end
def
create
@schedule
=
@host
.
schedules
.
new
(
fetch_params
)
@schedule
.
runtime
=
params
[
:schedule
][
:runtime
]
if
params
[
:schedule
][
:runtime
]
if
@schedule
.
save
if
@job_id
.
present?
redirect_to
edit_host_job_path
(
@host
,
@job_id
,
schedule_id
:
@schedule
.
id
)
else
redirect_to
new_host_job_path
(
@host
,
schedule_id
:
@schedule
.
id
)
end
else
render
:new
end
end
def
destroy
end
private
def
fetch_host
@host
=
Host
.
find
(
params
[
:host_id
]
)
end
def
fetch_job_id
@job_id
=
JobTemplate
.
find
(
params
[
:job_id
]
)
.
id
if
params
[
:job_id
].
present?
end
def
fetch_params
params
.
require
(
:schedule
)
.
permit
(
:name
)
end
end
Event Timeline
Log In to Comment