ログインしている場合にのみアクセスできるメイン ページのリンクがあります。ただし、このリンクをクリックすると、ログイン ページにカスタム エラー メッセージ (カスタム 'Message.auth') を表示したいと考えています。
ie I want (疑似コード)
if (referer == '/users/reserve'){
Message.auth = 'Please log in to reserve tickets';
}
else {
Message.auth = 'Please log in to access that page';
}
このコードをどこに配置しますか?