Class: Expat::TranslationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Expat::TranslationsController
- Defined in:
- app/controllers/expat/translations_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
33 34 35 36 37 |
# File 'app/controllers/expat/translations_controller.rb', line 33 def create @translations[params[:key]] = params[:value] save_translations redirect_to locale_translations_path(@locale) end |
#destroy ⇒ Object
39 40 41 42 43 |
# File 'app/controllers/expat/translations_controller.rb', line 39 def destroy @translations.delete params[:id] save_translations redirect_to locale_translations_path(@locale) end |
#edit ⇒ Object
20 21 22 |
# File 'app/controllers/expat/translations_controller.rb', line 20 def edit @translation = @translations[params[:id]] end |
#index ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/expat/translations_controller.rb', line 7 def index @translations = append_missing_translations @locale, @translations @translations = @translations.sort do |first, second| if first[1].nil? -1 elsif second[1].nil? 1 else 0 end end end |
#new ⇒ Object
30 31 |
# File 'app/controllers/expat/translations_controller.rb', line 30 def new end |
#update ⇒ Object
24 25 26 27 28 |
# File 'app/controllers/expat/translations_controller.rb', line 24 def update @translations[params[:id]] = params[:value] save_translations redirect_to locale_translations_path(@locale) end |