I would
```ruby
  def rhsm_index
    all_environments = if query_params.has_key?(:name)
                         # retrieve the requested environment
                         get_content_view_environments(query_params[:name])
                       else
                         # retrieve the list of all environments
                         get_content_view_environments
                       end
    render :json => all_environments.collect { |env| { :id          => env.cp_id,
                                                       :name        => env.label,
                                                       :description => env.content_view.description } }.flatten
  end
```
I am not sure, but `#flatten` seems redundant to me.