Skip to content

Commit 46ec84b

Browse files
committed
Update contacts_controller.rb
1 parent 0dc83c1 commit 46ec84b

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

app/controllers/contacts_controller.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ class ContactsController < ApplicationController
55

66
# GET /contacts/user
77
def user
8-
@contacts =
9-
current_user.contacts.paginate(page: params[:page], per_page: 30)
8+
@contacts = current_user
9+
.contacts.order(created_at: :asc)
10+
.paginate(page: params[:page], per_page: 30)
1011
render :index
1112
end
1213

1314
# GET /publications/1/contacts
1415
def index
15-
@contacts =
16-
@publication.contacts.paginate(page: params[:page], per_page: 30)
16+
@contacts = @publication
17+
.contacts.order(created_at: :asc)
18+
.paginate(page: params[:page], per_page: 30)
1719
end
1820

1921
# GET /publications/1/contacts/1

0 commit comments

Comments
 (0)