fixed new user registration

This commit is contained in:
zmagod 2016-10-12 12:02:04 +02:00
parent 8cd86a50bb
commit 8f24d0d80c
2 changed files with 7 additions and 0 deletions

View file

@ -158,6 +158,10 @@ class Users::RegistrationsController < Devise::RegistrationsController
organization: @org, organization: @org,
role: :admin role: :admin
) )
# set current organization to new user
resource.current_organization_id = @org.id
resource.save
end end
end end

View file

@ -101,10 +101,12 @@
</li> </li>
<!-- Global team switch --> <!-- Global team switch -->
<% if current_user.organizations.length > 1 %>
<li class="dropdown" id="team-switch"> <li class="dropdown" id="team-switch">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<span><%= current_organization.name %></span> <span><%= current_organization.name %></span>
</a> </a>
<ul class="dropdown-menu "> <ul class="dropdown-menu ">
<%= form_for(current_user, <%= form_for(current_user,
url: user_current_organization_path, url: user_current_organization_path,
@ -117,6 +119,7 @@
<% end %> <% end %>
</ul> </ul>
</li> </li>
<% end %>
<!-- greetings --> <!-- greetings -->
<li class="dropdown"> <li class="dropdown">