Skip to content
Extraits de code Groupes Projets
Valider 8306cfff rédigé par maxwell's avatar maxwell
Parcourir les fichiers

add token back to invite form

parent 177cc16e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -32,13 +32,17 @@ class InvitationsController < Devise::InvitationsController ...@@ -32,13 +32,17 @@ class InvitationsController < Devise::InvitationsController
def update def update
begin begin
puts "foobar"
puts params.inspect
user = User.find_by_invitation_token(params[:user][:invitation_token]) user = User.find_by_invitation_token(params[:user][:invitation_token])
puts user.inspect
user.seed_aspects user.seed_aspects
user.accept_invitation!(params[:user]) user.accept_invitation!(params[:user])
rescue MongoMapper::DocumentNotValid => e rescue MongoMapper::DocumentNotValid => e
user = nil user = nil
flash[:error] = e.message flash[:error] = e.message
end end
if user if user
flash[:notice] = I18n.t 'registrations.create.success' flash[:notice] = I18n.t 'registrations.create.success'
sign_in_and_redirect(:user, user) sign_in_and_redirect(:user, user)
......
...@@ -13,16 +13,14 @@ ...@@ -13,16 +13,14 @@
%p %p
= f.label :username , t('username') = f.label :username , t('username')
= f.text_field :username, :title => t('registrations.new.enter_username') = f.text_field :username, :title => t('registrations.new.enter_username')
%p
= f.label :email , t('email')
= f.text_field :email, :title => t('registrations.new.enter_email')
%p %p
= f.label :password , t('password') = f.label :password , t('password')
= f.password_field :password, :title => t('registrations.new.enter_password') = f.password_field :password, :title => t('registrations.new.enter_password')
%p %p
= f.label :password_confirmation , t('password_confirmation') = f.label :password_confirmation , t('password_confirmation')
= f.password_field :password_confirmation, :title => t('registrations.new.enter_password_again') = f.password_field :password_confirmation, :title => t('registrations.new.enter_password_again')
= f.hidden_field :invitation_token
= f.submit t('registrations.new.sign_up') = f.submit t('registrations.new.sign_up')
= render :partial => "devise/shared/links"
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter