Sha256: 63c74f83f0beed6d41b24b1126b3f2a2033088ed128ac50d3d0334177bc22701

Contents?: true

Size: 746 Bytes

Versions: 1

Compression:

Stored size: 746 Bytes

Contents

module C80OrderForm
  class MessController < ApplicationController

    def handle_message_order
      puts "<MessController.handle_message_order>"
      m = MessageOrder.new(mess_params)
      respond_to do |format|
        if m.save

          format.js
          MessageOrderMailer.send_mess(m, "Заявка").deliver # TODO_MY:: слово "заявка" поместить в базу, в модель настроек гема
        else
          puts "<MessController.handle_message_order> errors: #{m.errors}"
          format.js { render json: m.errors, status: :unprocessable_entity }
        end
      end
    end

    def mess_params
      params.require(:mess).permit(:name, :email_or_phone, :comment, :kapcha)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
c80_order_form-0.1.0.1 app/controllers/c80_order_form/mess_controller.rb