Class: RegistrationsController

Inherits:
ApplicationController show all
Includes:
Devise::Controllers::Helpers
Defined in:
app/controllers/registrations_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

caches_page_with_cache_marker, #raise_not_found!

Instance Method Details

#createObject



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
    }
     :account, @registration_form.session if !is_translator && @registration_form.session
  end

  respond_with @registration_form, location: registration_success_path
  # respond_with(@registration_form, location: order_payment_provider_redirect_url(@registration_form))
end

#newObject



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

#successObject



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