```ruby
class AddressesController < ApplicationController
  def index
    @addresses = Address.order("text").paginate(:page => params[:page])
  end

  def show
    @address = Address.find(params[:id])
    @emails = @address.emails.paginate(:page => params[:page])
  end
end
```

Sort list of emails on address page by date
user
```ruby
class AddressesController < ApplicationController
  def index
    @addresses = Address.order("text").paginate(:page => params[:page])
  end

  def show
    @address = Address.find(params[:id])
    @emails = @address.emails.order("created_at DESC").paginate(:page => params[:page])
  end
end
```
assistant