Topic: How to deal with redundant actions in controllers?
I have a "login" controller which includes an "add_user" action
I also have an "admin" controller -- meant to be used by system administrators only -- which also includes an "add_user" action
Both of the add_user actions share a lot of common code, but have a few important differences (they require different types of authentication to access, when an admin wants to add a user it doesn't require as many confirmation steps, and the layouts for the two are different).
Ideally I would like to not repeat myself so much. What is the best way to deal with this? I was thinking perhaps of putting part of the code into the application controller, but I'm not sure if that's entirely appropriate, and I'm not completely sure how I should be interacting with the application controller.
Would be great to get some advice on this.. Thanks!