On 21 Apr 2006, at 21:31, prplehaze wrote:
> What is the best practice for overloading an engine controller method?
Create a controller in your OWN app/controllers directory called
user_controller.rb like this:
class UserController < ApplicationController
def signup
# your code goes here
end
end
and your method will over-ride anything in /vendor/plugins
You only need to put in the methods you wish to over-ride, and
remember your method will replace the existing one, so you probably
want to start with copying/pasting the existing method code and then
adapting it if you only want to make small changes.
> 1. Allow the Guest role to access the signup method.
You need that. If you don't, nobody will be able to ever signup.
> 2. Alias the existing signup method to open_signup:
> alias_method :open_signup, :signup
You really don't need to do that. Just create a signup method in your
own controller that does things
> It seems like I'm missing something here.
What I've described above is actually mentioned in the Engines plugin
README, so I'd suggest you go read that, then the readme for
login_engine and user_engine and then you'll know what you can get
away with.
--
Paul Robinson
_______________________________________________
engine-users mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org