Class: C80FeedbackForm::MessController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- C80FeedbackForm::MessController
- Defined in:
- app/controllers/c80_feedback_form/mess_controller.rb
Instance Method Summary collapse
-
#handle_message_feedback ⇒ Object
skip_before_filter :verify_authenticity_token.
- #mess_params ⇒ Object
Instance Method Details
#handle_message_feedback ⇒ Object
skip_before_filter :verify_authenticity_token
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/c80_feedback_form/mess_controller.rb', line 6 def 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 |
#mess_params ⇒ Object
21 22 23 |
# File 'app/controllers/c80_feedback_form/mess_controller.rb', line 21 def mess_params params.require(:mess).permit(:name, :email_or_phone, :comment, :kapcha) end |