app/controllers/idioma/phrases_controller.rb
def update
      result = @phrase.update_and_update_backend(phrase_params)
      respond_to do |format|
        format.html {
          if result
            redirect_to [:edit, @phrase]
          else
            render :edit
          end
        }
        format.json {
          if result
            render json: @phrase
          else
            render json: {
              errors: @phrase.errors.messages
            }.merge(@phrase.attributes),
            status: :bad_request
          end
        }
      end

    end
def update
      result = @phrase.update_and_update_backend(phrase_params)
      respond_to do |format|
        format.html {
          if result
            redirect_to [:edit, @phrase]
          else
            render :edit
          end
        }
        format.json {
          if result
            render json: @phrase
          else
            render json: {
              errors: @phrase.errors.messages
            }.merge(@phrase.attributes),
            status: :bad_request
          end
        }
      end

    end
PATCH/PUT /phrases/1