Sha256: 6f9502a20351870ccf2bbc28e057e7e59d67f76d2cba604c411f2ba53d2dc319

Contents?: true

Size: 696 Bytes

Versions: 9

Compression:

Stored size: 696 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
          settings = Settings.first
          MessageOrderMailer.send_mess(m, settings.message_letter_subj).deliver
        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, :subj_id)
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
c80_order_form-0.1.0.11 app/controllers/c80_order_form/mess_controller.rb
c80_order_form-0.1.0.10 app/controllers/c80_order_form/mess_controller.rb
c80_order_form-0.1.0.9 app/controllers/c80_order_form/mess_controller.rb
c80_order_form-0.1.0.8 app/controllers/c80_order_form/mess_controller.rb
c80_order_form-0.1.0.7 app/controllers/c80_order_form/mess_controller.rb
c80_order_form-0.1.0.6 app/controllers/c80_order_form/mess_controller.rb
c80_order_form-0.1.0.5 app/controllers/c80_order_form/mess_controller.rb
c80_order_form-0.1.0.4 app/controllers/c80_order_form/mess_controller.rb
c80_order_form-0.1.0.3 app/controllers/c80_order_form/mess_controller.rb