Class: Mensa::Tables::FiltersController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/mensa/tables/filters_controller.rb

Defined Under Namespace

Classes: Filter

Instance Method Summary collapse

Instance Method Details

#indexObject



11
12
13
14
# File 'app/controllers/mensa/tables/filters_controller.rb', line 11

def index
  config = {}.merge(params.permit(:id, :page, :table_id, :target, :table_view_id, :turbo_frame_id, order: {}, filters: {}).to_h)
  @table = Mensa.for_name(params[:table_id], config)
end

#showObject

Returns the filter information on the column-name



17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/mensa/tables/filters_controller.rb', line 17

def show
  config = {}.merge(params.permit(:id, :page, :table_id, :target, :table_view_id, :turbo_frame_id, order: {}, filters: {}).to_h)
  @table = Mensa.for_name(params[:table_id], config)
  @table.original_view_context = helpers
  @column = @table.column(params[:id])
  respond_to do |format|
    format.turbo_stream
    format.html
  end
end