Sha256: 7422cf573f5602548543f8d14edf2d3ae516755bfebbd44076e30a84f0323d90

Contents?: true

Size: 725 Bytes

Versions: 8

Compression:

Stored size: 725 Bytes

Contents

module C80FeedbackForm
  class MessController < ApplicationController

    # skip_before_filter :verify_authenticity_token

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

          format.js
          MessageFeedbackMailer.send_mess(m, "Сообщение с сайта").deliver
        else
          puts "<MessController.handle_message_feedback> 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

8 entries across 8 versions & 1 rubygems

Version Path
c80_feedback_form-0.1.0.8 app/controllers/c80_feedback_form/mess_controller.rb
c80_feedback_form-0.1.0.6 app/controllers/c80_feedback_form/mess_controller.rb
c80_feedback_form-0.1.0.5 app/controllers/c80_feedback_form/mess_controller.rb
c80_feedback_form-0.1.0.4 app/controllers/c80_feedback_form/mess_controller.rb
c80_feedback_form-0.1.0.3 app/controllers/c80_feedback_form/mess_controller.rb
c80_feedback_form-0.1.0.2 app/controllers/c80_feedback_form/mess_controller.rb
c80_feedback_form-0.1.0.1 app/controllers/c80_feedback_form/mess_controller.rb
c80_feedback_form-0.1.0 app/controllers/c80_feedback_form/mess_controller.rb