Class: Vulgata::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Includes:
Controller, ControllerConfigurable
Defined in:
app/controllers/vulgata/application_controller.rb,
lib/generators/vulgata/templates/application_controller.rb

Instance Method Summary collapse

Methods included from Controller

#authorize_admin, #authorize_admin_or_proofreader, #authorize_admin_proofreader_or_assigned_translator, #authorize_all_role_holders, #layout_by_role, #root_redirect, #set_tranlsation_classes_if_admin, #set_tranlsation_count_if_translator, #set_vulgata_user, #translation_queue_sort

Instance Method Details

#suggest_translation(text, from, to) ⇒ Object

Raises:

  • (NotImplementedError)


18
19
20
21
22
23
# File 'lib/generators/vulgata/templates/application_controller.rb', line 18

def suggest_translation text, from, to
  # i.e
  # suggestion = TranslationApi.translate(text, from, to)
  # render json: { suggestion: suggestion }, status: :ok
  raise NotImplementedError
end

#vulgata_current_userObject

Raises:

  • (NotImplementedError)


6
7
8
9
10
# File 'lib/generators/vulgata/templates/application_controller.rb', line 6

def vulgata_current_user
  # i.e current_user (for devise)
  # the user object must respond to a :name method
  raise NotImplementedError
end

#vulgata_usersObject

Raises:

  • (NotImplementedError)


12
13
14
15
16
# File 'lib/generators/vulgata/templates/application_controller.rb', line 12

def vulgata_users
  # users that will appear in the "team" page
  # i.e User.where(role: 'translator')
  raise NotImplementedError
end