Commit 462c0b8972c1db2b5e45269ac3086661fd9e682b

Authored by DanielaFeitosa
1 parent 72c560f6

ActionItem6: enterprise controller update


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@179 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing 1 changed file with 8 additions and 2 deletions   Show diff stats
app/controllers/enterprise_controller.rb
1 # Manage enterprises by providing an interface to register, activate and manage them 1 # Manage enterprises by providing an interface to register, activate and manage them
2 class EnterpriseController < ApplicationController 2 class EnterpriseController < ApplicationController
3 3
  4 + def register
  5 + unless logged_in?
  6 + redirect_to :controller => 'account'
  7 + end
  8 + end
  9 +
4 def register_form 10 def register_form
5 @vitual_communities = VirtualCommunity.find(:all) 11 @vitual_communities = VirtualCommunity.find(:all)
6 end 12 end
@@ -13,10 +19,10 @@ class EnterpriseController &lt; ApplicationController @@ -13,10 +19,10 @@ class EnterpriseController &lt; ApplicationController
13 @enterprise = Enterprise.new(params[:enterprise]) 19 @enterprise = Enterprise.new(params[:enterprise])
14 if @enterprise.save 20 if @enterprise.save
15 flash[:notice] = _('Enterprise was succesfully created') 21 flash[:notice] = _('Enterprise was succesfully created')
16 - redirect_to :action => '' 22 + redirect_to :action => 'register'
17 else 23 else
18 flash[:notice] = _('Enterprise was not created') 24 flash[:notice] = _('Enterprise was not created')
19 - render :text => 'Não Salvou' 25 + render :action => 'choose_validation_entity_or_net'
20 end 26 end
21 end 27 end
22 end 28 end