Sha256: 9d3053c3ec5e27b950673d033309b71a6db314d3556751581bc3c732340132ca

Contents?: true

Size: 859 Bytes

Versions: 10

Compression:

Stored size: 859 Bytes

Contents

class EventsController < ApplicationController
  layout 'whoops'
  
  def index
    @event_group = Whoops::EventGroup.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).paginate(
      :page => params[:page],
      :per_page => 20
    )
    
    puts 'test'
  end
  
  def show
    @event = Whoops::Event.find(params[:id])
    respond_to do |format|
      format.js { render :partial => 'details', :object => @event, :as => :event}
    end
  end
  
  # TODO break this out into a more metal-y controller
  def create
    Whoops::Event.record(params[:event])
    render :status => 200, :nothing => true
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
whoops-0.1.9 app/controllers/events_controller.rb
whoops-0.1.8 app/controllers/events_controller.rb
whoops-0.1.7 app/controllers/events_controller.rb
whoops-0.1.6 app/controllers/events_controller.rb
whoops-0.1.5 app/controllers/events_controller.rb
whoops-0.1.4 app/controllers/events_controller.rb
whoops-0.1.3 app/controllers/events_controller.rb
whoops-0.1.2 app/controllers/events_controller.rb
whoops-0.1.1 app/controllers/events_controller.rb
whoops-0.1.0 app/controllers/events_controller.rb