Acts as Authenticated Multiple login screens


#1

I have need to display two distinguishing types of information on the
login.rhtml view, one for a hunter and the other for a recruiter. The
are both based on the same user model that acts as authenticated has
created.

Each of the methods hunter/index and recruiter/index redirect me to
account/login when I need to login to the system. I need a way to
find out from what the controller was before it hit the account/login
redirect, either it was recruiter or hunter.

Is there a way of doing getting the name of the controller before that
redirect and accessing it from the account/login view?


#2

Look at it as there are two partial views to be rendered with the
login screen. Either hunter or recruiter partial depending on which
link was clicked before the redirect to /account/login. I need a way
of finding out that controller name…


#3

On May 17, 4:12 pm, Valehru removed_email_address@domain.invalid wrote:

I have need to display two distinguishing types of information on the
login.rhtml view, one for a hunter and the other for a recruiter. The
are both based on the same user model that acts as authenticated has
created.

Each of the methods hunter/index and recruiter/index redirect me to
account/login when I need to login to the system. I need a way to
find out from what the controller was before it hit the account/login
redirect, either it was recruiter or hunter.

The session contains the originating request URL in
session[:return_to]. It’s messy, but you could parse the
route and figure out the component from there.

Or you could change lib/authenticated_system.rb to provide a more
elegant workflow for click-thru tracking.
-angel


#4

Or you could simply create two login actions and link to whichever one
is appropriate