Class: Applicants::ApplicantsController
Constant Summary
collapse
- PANEL_ID_PARAMETER_NAME =
'panel'
- CALLBACK_ERROR_MESSAGES =
{
ok: "OK",
internal_error: "Internal error",
url_missing: "URL is missing",
id_missing: "ID is missing",
id_not_found: "ID was not found",
transition: "Applicant already in final state. Callback Ignored."
}
- EVENT_PARAM =
'event'
- VIDEO_URL_PARAM =
'video_url'
- VIDEO_RECEIVED_EVENT =
'video_received'
Instance Method Summary
collapse
#admin_navigation_link, #current_translations, #detect_user_operating_system, #icon, #macintosh_activator_filename, #macintosh_activator_url, #macintosh_installer_url, #macintosh_operating_system_user?, #mobile_operating_system_user?, #screen_recorder_descriptor_url, #stale_state, #test_exclude, #video_transition_time_string, #viewing?, #windows_activator_filename, #windows_activator_url, #windows_installer_url, #windows_operating_system_user?
Instance Method Details
#activator ⇒ Object
103
104
105
106
107
108
109
110
111
|
# File 'app/controllers/applicants/applicants_controller.rb', line 103
def activator
if macintosh_operating_system_user?
render :activator_mac
elsif windows_operating_system_user?
render :activator_win
else
render :activator_mobile
end
end
|
#create ⇒ Object
52
53
54
55
56
57
58
59
60
61
62
|
# File 'app/controllers/applicants/applicants_controller.rb', line 52
def create
@applicant = Applicants::Applicant.new(params[:applicant])
if @applicant.save
redirect_to thank_you_applicant_path(email: @applicant.email)
else
render :new
end
rescue ActiveRecord::RecordNotUnique
@applicant.errors.add :email, :taken
render :new
end
|
#download ⇒ Object
76
77
78
79
80
81
82
83
84
85
86
|
# File 'app/controllers/applicants/applicants_controller.rb', line 76
def download
if macintosh_operating_system_user?
render :download_mac
elsif windows_operating_system_user?
render :download_win
elsif mobile_operating_system_user?
render :download_mobile
else
render :download
end
end
|
#index ⇒ Object
31
32
33
34
35
36
37
38
39
40
41
|
# File 'app/controllers/applicants/applicants_controller.rb', line 31
def index
respond_to do |format|
format.html { redirect_to new_applicant_url }
format.json do
if params[:q]
@applicants = Applicants::Applicant.where(params[:q])
end
end
end
end
|
#legacy_video_ready ⇒ Object
64
65
66
67
|
# File 'app/controllers/applicants/applicants_controller.rb', line 64
def legacy_video_ready
@applicant.video_ready!
render nothing: true, status: :ok
end
|
#new ⇒ Object
43
44
45
46
47
48
49
50
|
# File 'app/controllers/applicants/applicants_controller.rb', line 43
def new
@applicant = Applicants::Applicant.new
if @panel
@applicant.panel = @panel
@applicant.build_applicant_panel_parameter_set(panel_id: @panel.id, parameters: @parameters.to_json)
end
respond_with(@applicant)
end
|
#resend_confirmation_email ⇒ Object
96
97
98
99
100
101
|
# File 'app/controllers/applicants/applicants_controller.rb', line 96
def resend_confirmation_email
if @applicant = Applicants::Applicant.find_by_email(params[:email])
resend_email
end
render json: {message: I18n.t('applicants.request_response.email.check_email')}
end
|
#screen_recorder_callbacks ⇒ Object
69
70
71
72
73
74
|
# File 'app/controllers/applicants/applicants_controller.rb', line 69
def screen_recorder_callbacks
if params.has_key? :questions
@applicant.update_attribute(:answers, params[:questions])
end
render text: "1"
end
|
#thank_you ⇒ Object
27
28
29
|
# File 'app/controllers/applicants/applicants_controller.rb', line 27
def thank_you
@email = params[:email]
end
|
#tips ⇒ Object
88
89
90
91
92
93
94
|
# File 'app/controllers/applicants/applicants_controller.rb', line 88
def tips
if macintosh_operating_system_user?
render :tips_mac
else
render :tips
end
end
|
#video_server_callback ⇒ Object