Use the rails 4.2 active job

This commit is contained in:
2015-03-11 08:15:16 +01:00
parent cb3d1d5f02
commit 61d1a5998d
6 changed files with 14 additions and 5 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ class ContactFormsController < ApplicationController
def create
@contact_form = Cmtool::ContactForm.new(contact_form_params)
if @contact_form.save
Notifier.contact_form(@contact_form.id).deliver
Notifier.contact_form(@contact_form.id).deliver_later
redirect_to root_path, notice: t('contact_form.submitted')
else
redirect_to go_to_path('contact', locale: I18n.locale), alert: @contact_form.errors.full_messages.join(', ')