I tried this approach and found a few things...
class UsersController < ApplicationController
def do_signup
Hobo::Controller.request_host = request.host_with_port
Hobo::Controller.app_name = call_tag(:app_name)
hobo_do_signup do
if valid?
flash[:notice] = "Thanks for signing up!"
redirect_back_or_default(home_page)
end
end
end
end
The first 2 lines are copied from the request password action, but I think
they are needed everytime anything is getting emailed. I would like to move
this so this is available to all actions. I'll make it thread-safe too then.
Unless someone has a better idea to handle this? I want to keep it
per-request instead of setting it to some default, for applications that are
available to the internet but from intranets as well.
I changed the respond_to block to not logging in by default, since this
would bypass activation.
Maybe some sane handling code should check if the user signing up is active
(or doesn't have state). I can implement this if we agree on it.
Furthermore...
The activation email is sent before validation is checked and before saving,
this means that if the user is invalid, the form re-renders and nothing is
saved, but still the email gets sent!
If the user _is_ valid, the email is sent, but since the user isn't saved
yet, it doesn't have an ID, so the activation URL in the email is wrong
(/users/-username).
How should this be handled?
is there some 'after save' trigger?
In my userscontroller I created an activate action like this:
def activate
do_transition_action :activate do
if valid?
self.current_user = this
flash[:notice] = "Your account was successfully activated"
redirect_to home_page
end
end
end
But I keep on getting 'That operation is not allowed'.
I didn't look into it for now, it's probably trivial, but I thought I'dd
mention it anyways.
Any help on these issues will be useful.
Mathijs
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---