```ruby
class HostsController < ActionController::Base
  def index
    @hosts = Host.all

    render json: HostsPresenter.new(@hosts).as_hash.to_json
  end
end
```

Order the hosts API output based on the hostname, A-Z
user
```ruby
class HostsController < ActionController::Base
  def index
    @hosts = Host.all.order(:hostname)

    render json: HostsPresenter.new(@hosts).as_hash.to_json
  end
end
```
assistant