Commit 06e91ab0 by Xuan Trung Le

fix bugs

parent f80735ef
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
helper_method :clear_session
helper_method :clear_session_candidate
def clear_session
def clear_session_candidate
session[:candidate] = {}
end
end
......@@ -34,7 +34,7 @@ class AppliesController < ApplicationController
if @application.save
flash[:notice] = 'Congratulation! Job was successfully applied'
ApplyJobMailer.successful_email(@application).deliver_later
clear_session
clear_session_candidate
end
end
......
......@@ -7,7 +7,7 @@ class JobsController < ApplicationController
end
def show
clear_session
clear_session_candidate
end
def city
......
class ApplyJobMailer < ApplicationMailer
default from: 'from@example.com'
default from: 'notify@venjob.com'
def successful_email(application)
@application = application
mail(to: @application.email, subject: "Thank you for apply with VeNJOB")
mail(to: @application.email, subject: 'Thank you for apply with VeNJOB')
end
end
......@@ -14,9 +14,9 @@ Rails.application.routes.draw do
end
resources :applies do
collection do
get 'apply'
post 'confirm'
post 'done'
get :apply
post :confirm
post :done
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment