Class: Avocado::AvocadoController

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

Direct Known Subclasses

SpecsController

Instance Method Summary collapse

Instance Method Details

#createObject



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

def create
  File.open(json, 'w+:UTF-8') { |f| f.write params[:file].read }
  head :ok
end

#indexObject



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

def index
  @data = File.read(json)
  render '/template'
end