Class: Avocado::AvocadoController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Avocado::AvocadoController
- Defined in:
- app/controllers/avocado/avocado_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
4 5 6 7 8 |
# File 'app/controllers/avocado/avocado_controller.rb', line 4 def create contents = params[:file].read File.open(json, 'w+:UTF-8') { |f| f.write contents } head :ok end |
#index ⇒ Object
10 11 12 13 |
# File 'app/controllers/avocado/avocado_controller.rb', line 10 def index @data = File.read(json) render '/template' end |