Sort submissions by latest

This commit is contained in:
Yannick 2020-04-28 01:10:45 +02:00
parent 2a59c19a38
commit a5be6af3f7
3 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ gem 'rack-cors'
gem 'sentry-raven'
gem 'sequenced'
gem 'sorcery'
gem 'pagy', '~> 3.8'
gem 'pagy'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console

View File

@ -269,7 +269,7 @@ DEPENDENCIES
jbuilder
listen
lockbox
pagy (~> 3.8)
pagy
pg
puma
rack-cors

View File

@ -10,7 +10,7 @@ class FormsController < ApplicationController
def show
@form = current_user.forms.find_by!(token: params[:id])
@pagy, @submissions = pagy(@form.submissions, items: 25)
@pagy, @submissions = pagy(@form.submissions.order(created_at: :desc), items: 25)
end
def index