latest Aston req from OPT team

This commit is contained in:
phyusin
2018-03-21 17:45:55 +06:30
parent 0390d15e0a
commit 7063d937e3
8 changed files with 143 additions and 6 deletions

View File

@@ -1,5 +1,28 @@
class Transactions::SurveysController < ApplicationController
def index
@surveys = Survey.all
filter = params[:filter]
from = params[:from]
to = params[:to]
if filter.nil? && from.nil? && to.nil?
surveys = Survey.all
else
surveys = Survey.search(filter,from,to)
end
if !surveys.nil?
@surveys = Kaminari.paginate_array(surveys).page(params[:page]).per(20)
else
@surveys = []
end
@filter = filter
@from = from
@to = to
respond_to do |format|
format.html # index.html.erb
format.json { render json: @surveys }
end
end
end