Class: TranslationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- TranslationsController
- Defined in:
- app/controllers/translations_controller.rb
Instance Method Summary collapse
Instance Method Details
#translate ⇒ Object
4 5 6 7 8 9 |
# File 'app/controllers/translations_controller.rb', line 4 def translate translated = AutoTranslator.new(original: params[:original], to: params[:to]).perform render json: {status: 200, translated: translated} rescue Exception => e render json: {status: 500, error: e} end |