Sha256: 8f8c6135b3d08c8e8f7339b752ccf0216477d6e3af72f66338b4bb9380527b7f

Contents?: true

Size: 422 Bytes

Versions: 3

Compression:

Stored size: 422 Bytes

Contents

class TbCommerce::Api::OrdersController < TbCommerce::Api::BaseController

  def create
    @order = TbCommerce::Order.find_or_initialize_by(:cart => tb_commerce_current_cart())
    @order.assign_attributes(order_params)
    @order.save()
    respond_with @order
  end

private

  def order_params
    params.require(:tb_commerce_order).permit(:name, :email, :phone, :address, :city, :state, :postal, :country)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tb_commerce-0.0.4 app/controllers/tb_commerce/api/orders_controller.rb
tb_commerce-0.0.3 app/controllers/tb_commerce/api/orders_controller.rb
tb_commerce-0.0.2 app/controllers/tb_commerce/api/orders_controller.rb