3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'app/controllers/mensa/tables_controller.rb', line 3
def show
@table = Mensa.for_name(params[:id])
config = {}
if params[:table_view_id]
@view = Mensa::TableView.find_by(table_name: params[:id], id: params[:table_view_id])
@view ||= @table.system_views.find { |v| v.id == params[:table_view_id].to_sym }
config = @view&.config
end
config = config.merge(params.permit!.to_h)
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.request = request
@table.table_view = @view
@table.original_view_context = helpers
respond_to do |format|
format.turbo_stream
format.html
format.xlsx do
Mensa::ExportJob.perform_later(current_user, params[:id])
head :ok
end
end
end
|