Hi,
The mailing list archives appear to be down currently, so I wasn't
able to search them first.
What is the best practice for overloading an engine controller method?
I have Login Engine and User Engine installed. For example, I want
to override signup in user to show a different warning message than
"you need to login" (which I can accomplish by removing the guest
permission from the signup controller). Right now, I thought of one
way to do it:
1. Allow the Guest role to access the signup method.
2. Alias the existing signup method to open_signup:
alias_method :open_signup, :signup
3. Override the signup method to look something like this:
def signup
if !session[:user].nil?
open_signup
else
flash[:notice] = "Please contact the webmaster for a login"
access_denied
end
end
end
The problem with this is that I now need an open_signup.rhtml
file...which would just end up being the same rhtml as signup.rhtml in
the LoginEngine!
It seems like I'm missing something here.
Thanks in advance for the help.
- Sean
_______________________________________________
engine-users mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org