Module: ForemanDiscovery::Concerns::HostsControllerExtensions
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/controllers/foreman_discovery/concerns/hosts_controller_extensions.rb
Instance Method Summary collapse
- #host_for_template_used ⇒ Object
-
#set_discovered_params ⇒ Object
Change params to what the hosts controller expects.
Instance Method Details
#host_for_template_used ⇒ Object
17 18 19 20 21 |
# File 'app/controllers/foreman_discovery/concerns/hosts_controller_extensions.rb', line 17 def host_for_template_used super @host = ::ForemanDiscovery::HostConverter.to_managed(@host, true, false, host_params) if @host.is_a?(Host::Discovered) end |
#set_discovered_params ⇒ Object
Change params to what the hosts controller expects. Certain methods in the hosts controller like all the _selected methods, taxonomy_scope, etc.. expect a params to work.
12 13 14 15 |
# File 'app/controllers/foreman_discovery/concerns/hosts_controller_extensions.rb', line 12 def set_discovered_params return if params[:discovered_host].nil? params[:host] ||= params.delete(:discovered_host) end |