Forum: Ruby on Rails From RPC to REST, quick design decision, need help

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Marcelo de Moraes S. (Guest)
on 2009-02-22 04:28
(Received via mailing list)

Our app currently has an admin/logins/login_by_admin action. It
allows the admin to login as a regular user of the system from the list
users in the backend. However, it clutters the logins controller. I was
thinking on ways to clean up this design and make it more RESTful. One
approach is to use the action with an additional param (like
from_admin = true). The other option is to turn login_by_admin into it's
resource and put the logic into its new method. What do you think?


Maurício L. (Guest)
on 2009-02-22 05:38
(Received via mailing list)
Why isn`t admin just a role for a user instead of a completely
different "kind" of user?

If they were both the same, you woudn`t have any duplication at all
and woudn`t need any special case logic. If you can't do this, it's
better to have a separate resource to login admins, having a special
user clause at the main user's login controller isn`t great either.

Maurício Linhares (pt-br) |

On Sat, Feb 21, 2009 at 11:27 PM, Marcelo de Moraes S.
This topic is locked and can not be replied to.