Class: EventsController
- Inherits:
-
WhoopsController
- Object
- ApplicationController
- WhoopsController
- EventsController
- Defined in:
- app/controllers/events_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
TODO break this out into a more metal-y controller.
- #index ⇒ Object
- #show ⇒ Object
Instance Method Details
#create ⇒ Object
TODO break this out into a more metal-y controller
22 23 24 25 |
# File 'app/controllers/events_controller.rb', line 22 def create Whoops::NewEvent.new(params[:event]).record! render :status => 200, :nothing => true end |
#index ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 |
# File 'app/controllers/events_controller.rb', line 2 def index @event_group = Whoops::EventGroup.where(new_whoops_filter.to_query_document).find(params[:whoops_event_group_id]) events_base = @event_group.events unless params[:query].blank? conditions = Whoops::MongoidSearchParser.new(params[:query]).conditions events_base = events_base.where(conditions) end @events = events_base.desc(:event_time).page(params[:page]).per(20) end |