Class: Champollion::TranslationsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Champollion::TranslationsController
- Defined in:
- app/controllers/champollion/translations_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /translations.
-
#destroy ⇒ Object
DELETE /translations/1.
-
#edit ⇒ Object
GET /translations/1/edit.
-
#index ⇒ Object
GET /translations.
-
#new ⇒ Object
GET /translations/new.
-
#show ⇒ Object
GET /translations/1.
-
#update ⇒ Object
PATCH/PUT /translations/1.
Instance Method Details
#create ⇒ Object
POST /translations
29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/champollion/translations_controller.rb', line 29 def create @translation = Translation.new(translation_params) if @translation.save redirect_to @translation, notice: 'Translation was successfully created.' else render :new end end |
#destroy ⇒ Object
DELETE /translations/1
49 50 51 52 |
# File 'app/controllers/champollion/translations_controller.rb', line 49 def destroy @translation.destroy redirect_to translations_url, notice: 'Translation was successfully destroyed.' end |
#edit ⇒ Object
GET /translations/1/edit
25 26 |
# File 'app/controllers/champollion/translations_controller.rb', line 25 def edit end |
#index ⇒ Object
GET /translations
8 9 10 11 12 13 |
# File 'app/controllers/champollion/translations_controller.rb', line 8 def index respond_to do |format| format.html { @translations = Translation.all } format.json { render json: Translation.all_hash.to_json } end end |
#new ⇒ Object
GET /translations/new
20 21 22 |
# File 'app/controllers/champollion/translations_controller.rb', line 20 def new @translation = Translation.new end |
#show ⇒ Object
GET /translations/1
16 17 |
# File 'app/controllers/champollion/translations_controller.rb', line 16 def show end |
#update ⇒ Object
PATCH/PUT /translations/1
40 41 42 43 44 45 46 |
# File 'app/controllers/champollion/translations_controller.rb', line 40 def update if @translation.update(translation_params) redirect_to @translation, notice: 'Translation was successfully updated.' else render :edit end end |