views:

31

answers:

1

Hello I have been trying for several days using nested attributes, etc. Basically, I want a User to SIGN UP. Once the User is 'Signed Up' I want them to be redirected to 'Create Your Team' page.

Once they created their Team, then they are redirected to their Team Dashboard.

But what if a User didn't create the Team right away? I would like it so the system detects that they have not created a Team and redirects them, otherwise go to Dashboard.

I'm not sure what would be the best practice in doing this. I was hoping to find some Github project for doing this but to no avail.

Thanks

A: 

I would make the controller something like..

def login
  unless current_user.exists?(team)
    redirect_to create_team
  else
    redirect_to root_url
   end
 end

That's so psuedo-code.

Trip