Class: LocalesAdmin::MainController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- LocalesAdmin::MainController
- Defined in:
- app/controllers/locales_admin/main_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
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 |
#logout ⇒ Object
20 21 22 |
# File 'app/controllers/locales_admin/main_controller.rb', line 20 def logout redirect_to "/", status: 401 end |
#show ⇒ Object
10 11 12 |
# File 'app/controllers/locales_admin/main_controller.rb', line 10 def show @file = File.open(params[:file]) end |
#update ⇒ Object
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 |