Class: Breeze::TranslationsController
- Inherits:
-
BreezeController
- Object
- ApplicationController
- BreezeController
- Breeze::TranslationsController
- Defined in:
- app/controllers/breeze/translations_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /translations.
-
#destroy ⇒ Object
DELETE /translations/1.
-
#edit ⇒ Object
GET /translations/1/edit.
-
#new ⇒ Object
GET /translations/new.
-
#show ⇒ Object
show all translation for a page.
-
#update ⇒ Object
PATCH/PUT /translations/1.
Methods inherited from BreezeController
#authenticate_if, #current_member_email
Instance Method Details
#create ⇒ Object
POST /translations
20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/breeze/translations_controller.rb', line 20 def create @translation = Translation.new(translation_params) if @translation.save redirect_to @translation, notice: "Translation was successfully created." else render :new, status: :unprocessable_entity end end |
#destroy ⇒ Object
DELETE /translations/1
43 44 45 46 |
# File 'app/controllers/breeze/translations_controller.rb', line 43 def destroy @translation.destroy redirect_to translations_url, notice: "Translation was successfully destroyed.", status: :see_other end |
#edit ⇒ Object
GET /translations/1/edit
16 17 |
# File 'app/controllers/breeze/translations_controller.rb', line 16 def edit end |
#new ⇒ Object
GET /translations/new
11 12 13 |
# File 'app/controllers/breeze/translations_controller.rb', line 11 def new @translation = Translation.new end |
#show ⇒ Object
show all translation for a page
6 7 8 |
# File 'app/controllers/breeze/translations_controller.rb', line 6 def show @page = Page.find(params[:id].to_i) end |
#update ⇒ Object
PATCH/PUT /translations/1
31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/breeze/translations_controller.rb', line 31 def update respond_to do |format| @translation.update(translation_params , current_member_email ) format.html { redirect_to(translation_path(@translation.object.page.id), :notice => 'Translation was successfully updated.') } format.json { render status: 200, json: {} } end end |