Hi All,
I''m using the generic salted login generator in my app to create user
accounts. I also have a model/controller called staffmember.
What I would like to do is when an administrator creates a new
staffmember, I would like my app to autogenerate a new Account and
login (using a generic password which will have to be changed)
For the life of me I can''t seem to get this to work - my (admittedly
bad) logic so far looks roughly like:
(in Staffmember controller)
def create
@staffmember = Staffmember.new(@params[''staffmember''])
if @staffmember.save
#once new staffmember has been created...
@newUser = User.new
#do some magic here to call the signup method in the
account model or some such...
redirect_to :action => ''list''
else
render_action ''new''
end
end