From which page request generted for Devise login on rails
<p>I am working on an app in which there is a model <strong>User</strong> with roles <strong>member</strong> and <strong>Admin</strong>.</p>

<p>As per requirement, I have to made two separate login pages for roles of Admin and Member.</p>

<p>with <code>http://localhost:3000/admin/admin_login</code></p>

<p>it goes to admin login page and with</p>

<pre><code>http://localhost:3000/users/sign_in
</code></pre>

<p>it goes to member login page.</p>

<p>Somehow I managed to route according scenerio, after sign_in and sigout to respective admin panel or normal website for member.</p>

<p>But Now there is issue that when login fails it redirect it to <code>http://localhost:3000/users/sign_in</code> even if in admin case.</p>

<p>Is there a way that I can know, From where this request is generated either from </p>

<p><code>/admin</code> or <code>/users/sign_in</code> ?</p>

<p>So that I can redirect them to respective page</p>