Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F1615366
simple_configs_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, Mar 22, 12:11 AM
Size
741 B
Mime Type
text/x-ruby
Expires
Tue, Mar 24, 12:11 AM (1 h, 40 m)
Engine
blob
Format
Raw Data
Handle
354383
Attached To
rARCHIVING archiving
simple_configs_controller.rb
View Options
class
SimpleConfigsController
<
ApplicationController
before_action
:require_logged_in
before_action
:fetch_host
# GET /hosts/1/simple_configs/new
def
new
@simple_config
=
SimpleConfiguration
.
new
@simple_config
.
randomize
end
# POST /hosts/1/simple_configs
def
create
@simple_config
=
SimpleConfiguration
.
new
(
fetch_config_params
)
if
@simple_config
.
valid?
&&
@simple_config
.
create_config
(
@host
)
redirect_to
host_path
(
@host
,
anchor
:
:jobs
)
else
render
:new
end
end
private
def
fetch_host
@host
=
current_user
.
hosts
.
find
(
params
[
:host_id
]
)
end
def
fetch_config_params
params
.
require
(
:simple_configuration
)
.
permit
(
:name
,
:day
,
:hour
,
:minute
,
included_files
:
[]
)
end
end
Event Timeline
Log In to Comment