diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index a6e44934ebf0ed5e085d45a253274ab12131eacc..5607698e7e1fefc95bd55af29fe130ea6185eb2c 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 cea40941ce966d64519a4fcb86f4e59c4dd31f1b..3dd99446e8f9b805e8dcf2cb1a63ee2a94805aa8 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"