add token back to invite form
This commit is contained in:
parent
177cc16e2f
commit
8306cfffde
2 changed files with 6 additions and 4 deletions
|
|
@ -32,13 +32,17 @@ class InvitationsController < Devise::InvitationsController
|
|||
|
||||
def update
|
||||
begin
|
||||
puts "foobar"
|
||||
puts params.inspect
|
||||
user = User.find_by_invitation_token(params[:user][:invitation_token])
|
||||
puts user.inspect
|
||||
user.seed_aspects
|
||||
user.accept_invitation!(params[:user])
|
||||
rescue MongoMapper::DocumentNotValid => e
|
||||
user = nil
|
||||
flash[:error] = e.message
|
||||
end
|
||||
|
||||
if user
|
||||
flash[:notice] = I18n.t 'registrations.create.success'
|
||||
sign_in_and_redirect(:user, user)
|
||||
|
|
|
|||
|
|
@ -13,16 +13,14 @@
|
|||
%p
|
||||
= f.label :username , t('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
|
||||
= f.label :password , t('password')
|
||||
= f.password_field :password, :title => t('registrations.new.enter_password')
|
||||
%p
|
||||
= f.label :password_confirmation , t('password_confirmation')
|
||||
= f.password_field :password_confirmation, :title => t('registrations.new.enter_password_again')
|
||||
= f.hidden_field :invitation_token
|
||||
|
||||
= f.submit t('registrations.new.sign_up')
|
||||
= render :partial => "devise/shared/links"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue