Class: OrdersController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

caches_page_with_cache_marker, #raise_not_found!

Instance Method Details

#createObject



21
22
23
24
25
26
27
28
29
30
31
# File 'app/controllers/orders_controller.rb', line 21

def create
  @form = OrderForm.new(params)
  # @customer.assign_attributes(customer_params)

  if @form.valid? && @form.submit && .blank? && @form.session
     = TranslationCms::Api::Customer.new(session: @form.session)
    _signed = (:account, ) if 
  end

  respond_with(@form, location: order_payment_provider_redirect_url(@form.order))
end

#newObject



11
12
13
14
15
16
17
18
19
# File 'app/controllers/orders_controller.rb', line 11

def new
  @account = 
  @form = OrderForm.new(
    account: { country_code: request_country_code },
    order: { fileupload_token: SecureRandom.base64(15).tr('+/=', 'xyz') },
    customer_mode_id: @account.blank? ? CustomerMode..id : CustomerMode.signed.id
  )
  respond_with(@form)
end