Sha256: cf4e625f5fa80aebcad1dbf403c9d789deb5c76b49e0a3991e0a03292bef12af

Contents?: true

Size: 648 Bytes

Versions: 6

Compression:

Stored size: 648 Bytes

Contents

module Co
  class CartController < ::ApplicationController

    def give_me_cart_order_form
    end

    def message_cart_order
      puts '<CartController.message_cart_order>'
      m = OrderMessage.new(mess_params)
      respond_to do |format|
        if m.save

          format.js
          OrderMessageMailer.send_mess(m, 'Заказ').deliver
        else
          puts "<CartController.message_cart_order> errors: #{m.errors}"
          format.js { render json: m.errors, status: :unprocessable_entity }
        end
      end
    end

    def mess_params
      params.require(:mess).permit(:name, :phone, :comment, :city)
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
c80_yax-0.1.0.25 engines/co/app/controllers/co/cart_controller.rb
c80_yax-0.1.0.24 engines/co/app/controllers/co/cart_controller.rb
c80_yax-0.1.0.23 engines/co/app/controllers/co/cart_controller.rb
c80_yax-0.1.0.22 engines/co/app/controllers/co/cart_controller.rb
c80_yax-0.1.0.21 engines/co/app/controllers/co/cart_controller.rb
c80_yax-0.1.0.20 engines/co/app/controllers/co/cart_controller.rb