In Application Controller:
def stored_location_for( resource )
if current_user
if current_user.sign_in_count <= 1
UserMailer.deliver_first_visit(current_user)
elsif ( current_user.first_name.blank? ||
current_user.last_name.blank? || current_user.phone.blank? ||
current_user.company_name.blank? )
set_flash_message :notice, 'Please update your profile'
return '/users/' + current_user.id.to_s + '/edit'
end
end
super( resource )
end
In my workflow, I am using devise_invitable to send invitations, and
each time an invitation is accepted, the person who did the inviting
(an admin in my workflow) gets a message back saying that the person
has accepted the invitation. So that's the first login part. Then the
next time they log in, I bug them to update their profile with more
information that the inviter didn't enter.
Walter
def activate_user!
if current_user.enabled
true
else
flash[:error] = I18n.t("interface.first_password")
current_user.reset_password_token = Devise.friendly_token
current_user.save
redirect_to edit_password_path(current_user, :reset_password_token => current_user.reset_password_token)
end
endWalter