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 'sentry-raven'
gem 'sequenced' gem 'sequenced'
gem 'sorcery' gem 'sorcery'
gem 'pagy', '~> 3.8' gem 'pagy'
group :development, :test do group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console # Call 'byebug' anywhere in the code to stop execution and get a debugger console

View File

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

View File

@ -10,7 +10,7 @@ class FormsController < ApplicationController
def show def show
@form = current_user.forms.find_by!(token: params[:id]) @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 end
def index def index