Skip to content

Instantly share code, notes, and snippets.

@janjiss
Created September 5, 2012 06:27
Show Gist options
  • Save janjiss/3631631 to your computer and use it in GitHub Desktop.
Save janjiss/3631631 to your computer and use it in GitHub Desktop.
def new
if current_user && current_user.has_products?
redirect_to :action => :edit
elsif current_user && current_user.has_no_products?
current_user.create_product!
redirect_to :action => :edit
else
redirect_to root_url
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment