From 8306cfffdeaf217bae9705aaa09317996f3e3449 Mon Sep 17 00:00:00 2001 From: maxwell Date: Sat, 4 Dec 2010 16:03:35 -0800 Subject: [PATCH] add token back to invite form --- app/controllers/invitations_controller.rb | 4 ++++ app/views/invitations/edit.html.haml | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index a6e44934e..5607698e7 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -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) diff --git a/app/views/invitations/edit.html.haml b/app/views/invitations/edit.html.haml index cea40941c..3dd99446e 100644 --- a/app/views/invitations/edit.html.haml +++ b/app/views/invitations/edit.html.haml @@ -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"