class ApplicationController < ActionController::Base
  protect_from_forgery

  rescue_from CanCan::AccessDenied do |exception|
    @exception = exception
    render :template => 'home/access_violation', :status => 403
  end
end

class ApplicationController < ActionController::Base
  protect_from_forgery

  rescue_from CanCan::AccessDenied do |exception|
    @violation = exception
    render :template => 'home/access_violation', :status => 403
  end
end

Update Violation Page for Error Message
Update Violation Page for Error Message

Update the Violation page to ensure the error is displayed in the view.
