Class: LocalesAdmin::MainController

Inherits:
ApplicationController show all
Defined in:
app/controllers/locales_admin/main_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
# File 'app/controllers/locales_admin/main_controller.rb', line 5

def index
  @files = Dir.glob Rails.root.join("config", "locales", "**", "*.yml")
end

#showObject



9
10
11
# File 'app/controllers/locales_admin/main_controller.rb', line 9

def show
  @file = File.open(params[:file])
end

#updateObject



13
14
15
16
17
# File 'app/controllers/locales_admin/main_controller.rb', line 13

def update
  @file = File.open(params[:file], "w+")
  @file.write(params[:editor])
  @file.read
end