You could probably just make this:

```ruby
@products = params[:ids].map { |id| Product.find_by_cp_id!(id) }
```

You should probably handle the case where ids is not defined too.