Module: ForemanWds::HostsControllerExtensions
- Defined in:
- app/controllers/concerns/foreman_wds/hosts_controller_extensions.rb
Instance Method Summary collapse
Instance Method Details
#host_params(top_level_hash = controller_name.singularize) ⇒ Object
11 12 13 14 15 16 |
# File 'app/controllers/concerns/foreman_wds/hosts_controller_extensions.rb', line 11 def host_params(top_level_hash = controller_name.singularize) # Don't create a WDS facet unless provisioning with it params[:host].delete :wds_facet_attributes if params[:host] && params[:host][:provision_method] != 'wds' super(top_level_hash) end |
#wds_server_selected ⇒ Object
3 4 5 6 7 8 9 |
# File 'app/controllers/concerns/foreman_wds/hosts_controller_extensions.rb', line 3 def wds_server_selected host = @host || item_object wds_facet = host.wds_facet || host.build_wds_facet wds_facet.wds_server_id ||= (params[:wds_facet] || params[:host])[:wds_server_id] render partial: 'wds_servers/image_select', locals: { item: wds_facet } end |