edit
This commit is contained in:
@@ -3,7 +3,9 @@ class BatchLineItemsController < ApplicationController
|
||||
skip_before_filter :verify_authenticity_token
|
||||
before_action :authenticate_member!
|
||||
def index
|
||||
@batches=Batch.all
|
||||
user_id=current_member.user_id
|
||||
|
||||
@batches=Batch.where('user_id=?',user_id)
|
||||
@batchLineItems=BatchLineItem.joins('inner join batches on batches.id=batch_line_items.batch_id').select('batch_line_items.*,batches.order_ref as batch_name').page(params[:page]).per(2)
|
||||
end
|
||||
def export
|
||||
@@ -28,6 +30,7 @@ class BatchLineItemsController < ApplicationController
|
||||
end
|
||||
@batchLineItems = BatchLineItem.all.select('serial_no,wristband_code,batch_id,manufacture_uid,card_type')
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.csv { send_data @batchLineItems.to_csv(user_id), filename: "encoder-#{Date.today}.csv" }
|
||||
|
||||
Reference in New Issue
Block a user