Class: Eventsimple::ModelsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/eventsimple/models_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#event_class_names, #event_classes

Instance Method Details

#showObject



3
4
5
6
7
8
9
10
11
12
# File 'app/controllers/eventsimple/models_controller.rb', line 3

def show
  @model_name = params[:name]
  model_class = event_classes.find { |d| d.name == @model_name }

  scope = apply_filter(model_class, model_class.event_class)

  @latest_entities = scope.last(20).reverse

  check_redirect_to_entity
end