Class: Avocado::SpecsController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/avocado/specs_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



9
10
11
12
13
# File 'app/controllers/avocado/specs_controller.rb', line 9

def create
  File.open(new_json_filename, 'w+') { |f| f.write params[:file].read }
  File.delete(*json_files_from_past_uploads)
  head :ok
end

#indexObject



5
6
7
# File 'app/controllers/avocado/specs_controller.rb', line 5

def index
  @data = json_files.map { |filename| File.read filename }
end