Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F401899
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
Thu, Feb 20, 4:24 PM
Size
741 B
Mime Type
text/x-ruby
Expires
Sat, Feb 22, 4:24 PM (21 h, 57 m)
Engine
blob
Format
Raw Data
Handle
191870
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