Actions
Feature #865
closedcreate method for updating multiple hosts via name instead of id
Description
I need a method to update multiple hosts via a name. I altered some code but I don't understand how the find function works with the params.
Need some clarification on whats going on with the following line of code.
@hosts = Host.find(params[:host_names], :order => "hostgroup_id ASC")
Here is what I put together as a future patch for this feature.
def find_multiple if not params[:host_ids].blank? @hosts = Host.find(params[:host_ids], :order => "hostgroup_id ASC") elsif not params[:host_names].blank? @hosts = Host.find(params[:host_names], :order => "hostgroup_id ASC") else error 'No Hosts selected' redirect_to(hosts_path) and return false end rescue => e error "Something went wrong while selecting hosts - #{e}" redirect_to hosts_path end
Updated by Ohad Levy over 13 years ago
- Status changed from New to Ready For Testing
- % Done changed from 0 to 100
Applied in changeset 2b0af5e72284c830ef58393222e689399a0c8150.
Updated by Ohad Levy over 13 years ago
- Category set to API
- Status changed from Ready For Testing to Closed
- Target version set to 0.3
Actions