Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F2569789
hosts_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
Wed, Jun 10, 6:48 PM
Size
692 B
Mime Type
text/x-ruby
Expires
Fri, Jun 12, 6:48 PM (1 d, 16 h)
Engine
blob
Format
Raw Data
Handle
395714
Attached To
rARCHIVING archiving
hosts_controller.rb
View Options
class
HostsController
<
ApplicationController
# before_action :fetch_params, only: :create
before_action
:fetch_host
,
only
:
[
:show
,
:edit
,
:update
,
:destroy
]
# GET /hosts
def
new
@host
=
Host
.
new
end
# POST /hosts
def
create
@host
=
Host
.
new
(
fetch_params
)
if
@host
.
save
redirect_to
root_path
else
render
:new
end
end
# GET /hosts/1
def
show
;
end
# GET /hosts/1/edit
def
edit
;
end
# PUT /hosts/1
def
update
;
end
# DELETE /hosts/1
def
destroy
#@host.destroy
end
private
def
fetch_host
@host
=
Host
.
find
(
params
[
:id
]
)
end
def
fetch_params
params
.
require
(
:host
)
.
permit
(
:fqdn
,
:port
,
:password
)
end
end
Event Timeline
Log In to Comment