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
8
# File 'app/controllers/locales_admin/main_controller.rb', line 5

def index

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

#logoutObject



20
21
22
# File 'app/controllers/locales_admin/main_controller.rb', line 20

def logout
  redirect_to "/", status: 401
end

#showObject



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

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

#updateObject



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

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