Forum: Ruby on Rails Email Suffix Matching Helper

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C5de46ba2bbb6ac7a0744ddae42d60f5?d=identicon&s=25 DanC (Guest)
on 2011-01-19 19:28
(Received via mailing list)
In the App I am working on people subscribe from universities so they
tend to have very standard email addresses.

e.g. Durham University = @dur.ac.or or @durham.ac.uk

For some of these universities I want to display extra information
when the user logs in, but not for others and that information will be
university specific

i.e. If a user with first.name@durham.ac.uk logs in I want them to see
a Durham University specific imag on their homepagee, but if a user
from Newcastle with first.name@newcastle.ac.uk logs in they should see
a different image (or no image at all).

I would like to try and do this on email suffix recognition rather
than asking the user to specify their university at login if there is
an elegant way of doing so.

All suggestions welcome.

Thanks,

Dan
C2b69b81423cc41257b4afa40d860a09?d=identicon&s=25 djangst (Guest)
on 2011-01-19 19:55
(Received via mailing list)
Where will the extra information live? In a model, or templates? Is it
static or dynamic content, managed or unmanaged?

School information can be attached to the user at login (in session,
for example), and/or stored permanently. It's easy enough to extract
the school information if login is via email address, or pull it from
the database if there are separate user names.
This topic is locked and can not be replied to.