Class: Admin::TranslationsController
- Inherits:
-
ForestController
- Object
- ForestController
- Admin::TranslationsController
- Defined in:
- app/controllers/admin/translations_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'app/controllers/admin/translations_controller.rb', line 21 def create @translation = Translation.new(translation_params) @translation if @translation.save redirect_to edit_admin_translation_path(@translation), notice: 'Translation was successfully created.' else render :new end end |
#destroy ⇒ Object
42 43 44 45 46 |
# File 'app/controllers/admin/translations_controller.rb', line 42 def destroy @translation @translation.destroy redirect_to admin_translations_url, notice: 'Translation was successfully destroyed.' end |
#edit ⇒ Object
17 18 19 |
# File 'app/controllers/admin/translations_controller.rb', line 17 def edit @translation end |
#index ⇒ Object
4 5 6 |
# File 'app/controllers/admin/translations_controller.rb', line 4 def index @translations = apply_scopes(Translation).by_key.page params[:page] end |
#new ⇒ Object
12 13 14 15 |
# File 'app/controllers/admin/translations_controller.rb', line 12 def new @translation = Translation.new @translation end |
#show ⇒ Object
8 9 10 |
# File 'app/controllers/admin/translations_controller.rb', line 8 def show @translation end |
#update ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/admin/translations_controller.rb', line 32 def update @translation if @translation.update(translation_params) redirect_to edit_admin_translation_path(@translation), notice: 'Translation was successfully updated.' else render :edit end end |