Class: Avocado::SpecsController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Avocado::SpecsController
- Defined in:
- app/controllers/avocado/specs_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
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 |
#index ⇒ Object
5 6 7 |
# File 'app/controllers/avocado/specs_controller.rb', line 5 def index @data = json_files.map { |filename| File.read filename } end |