9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'app/controllers/mensa/tables_controller.rb', line 9
def show
config = if params[:table_view_id]
@view = Mensa::TableView.find_by(table_name: params[:id], id: params[:table_view_id])
@view&.data || {}
else
{}
end
config = config.merge(params.permit(:format, :query, :id, :page, :table_view_id, :turbo_frame_id, order: {}, filters: {}).to_h)
@table = Mensa.for_name(params[:id], config)
@table.table_view = @view
@table.original_view_context = helpers
respond_to do |format|
format.turbo_stream
format.html
format.xlsx do
Mensa::ExportJob.perform_async(current_user.id, params[:id])
head 200
end
end
end
|