Class: Eras::ErrorsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/eras/errors_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



14
15
16
17
18
# File 'app/controllers/eras/errors_controller.rb', line 14

def destroy
  # TODO: rename to be adapter agnostic
  Eras.adapter.destroy_file
  redirect_to :root
end

#indexObject



6
7
8
# File 'app/controllers/eras/errors_controller.rb', line 6

def index
  @errors = Eras.adapter.read_errors.filter { |e| e['context']['rails_env'] == @environment }
end

#set_environmentObject



20
21
22
# File 'app/controllers/eras/errors_controller.rb', line 20

def set_environment
  @environment = params[:environment] || 'development'
end

#set_file_attrsObject



24
25
26
27
# File 'app/controllers/eras/errors_controller.rb', line 24

def set_file_attrs
  @file_path = Eras.adapter.path
  @file_size = Eras.adapter.file_size
end

#showObject



10
11
12
# File 'app/controllers/eras/errors_controller.rb', line 10

def show
  @error = Eras.adapter.read_error(params[:id])
end