Class: LesliBabel::ClonesController
- Inherits:
-
ApplicationController
- Object
- Lesli::ApplicationLesliController
- ApplicationController
- LesliBabel::ClonesController
- Defined in:
- app/controllers/lesli_babel/clones_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /clones.
-
#destroy ⇒ Object
DELETE /clones/1.
-
#edit ⇒ Object
GET /clones/1/edit.
-
#new ⇒ Object
GET /clones/new.
-
#show ⇒ Object
GET /clones/1.
-
#update ⇒ Object
PATCH/PUT /clones/1.
Instance Method Details
#create ⇒ Object
POST /clones
43 44 45 46 47 48 49 |
# File 'app/controllers/lesli_babel/clones_controller.rb', line 43 def create result = TranslationsCloneService.remote_clone(clone_params[:instance_code]) respond_with_successful if result.success? respond_with_error if not result.success? end |
#destroy ⇒ Object
DELETE /clones/1
63 64 65 66 67 68 69 70 71 |
# File 'app/controllers/lesli_babel/clones_controller.rb', line 63 def destroy return respond_with_not_found unless @clone if @clone.destroy respond_with_successful else respond_with_error(@clone.errors..to_sentence) end end |
#edit ⇒ Object
GET /clones/1/edit
39 40 |
# File 'app/controllers/lesli_babel/clones_controller.rb', line 39 def edit end |
#new ⇒ Object
GET /clones/new
35 36 |
# File 'app/controllers/lesli_babel/clones_controller.rb', line 35 def new end |
#show ⇒ Object
GET /clones/1
25 26 27 28 29 30 31 32 |
# File 'app/controllers/lesli_babel/clones_controller.rb', line 25 def show respond_to do |format| format.html {} format.json do return respond_with_successful() end end end |
#update ⇒ Object
PATCH/PUT /clones/1
52 53 54 55 56 57 58 59 60 |
# File 'app/controllers/lesli_babel/clones_controller.rb', line 52 def update return respond_with_not_found unless @clone if @clone.update(clone_params) respond_with_successful(@clone.show(current_user, @query)) else respond_with_error(@clone.errors..to_sentence) end end |