Sha256: 14d393276a2b2840d9b06bb29e1ad1f0c9bfe1b1bfabc678b52686be96fa8574
Contents?: true
Size: 635 Bytes
Versions: 6
Compression:
Stored size: 635 Bytes
Contents
require_dependency "ishapi/application_controller" module Ishapi class OrdersController < ApplicationController before_action :check_profile, :only => [ :create ] def create authorize! :create, CoTailors::Order # byebug @order = CoTailors::Order.where( :profile_id => @current_profile.id, :submitted_at => nil ).first @order.submitted_at = Time.now flag = @order.save if flag render :json => { :status => :ok, :message => 'Successfully placed the order' } else render :json => { :status => :not_ok, :error => @order.errors.messages } end end end end
Version data entries
6 entries across 6 versions & 1 rubygems