Class: RegistrationsController
Instance Method Summary
collapse
caches_page_with_cache_marker, #raise_not_found!
Instance Method Details
#create ⇒ Object
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'app/controllers/registrations_controller.rb', line 28
def create
is_translator = params[:translator].present?
if @registration_form.valid? && @registration_form.submit(is_translator)
cookies[:registration_success] = {
value: is_translator ? 'translator' : 'customer',
expires: 1.day.from_now
}
sign_in :account, @registration_form.session if !is_translator && @registration_form.session
end
respond_with @registration_form, location: registration_success_path
end
|
#new ⇒ Object
15
16
17
18
|
# File 'app/controllers/registrations_controller.rb', line 15
def new
@registration_form.country_code ||= request_country_code
respond_with @registration_form
end
|
#success ⇒ Object
20
21
22
23
24
25
26
|
# File 'app/controllers/registrations_controller.rb', line 20
def success
@structure = structure_by(slug: 'additional-registration-success')
@customer_content = @structure.try(:main)
@translator_content = @structure.try(:footer)
respond_with @structure
end
|