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
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

#indexObject



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

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