Search code examples
ruby-on-railsruby-on-rails-3widgetplaxo

Plaxo email contact widget unable to return emails addresses to the app server


I'm trying to get plaxo's Address Book Access working. I'm having the following problem:

My entire user login process is done via ajax while the user is on the root url. When the user successfully logs in, I render landing/logged_in.js.erb which contains

$("#content").html("<%= escape_javascript(render :partial => 'email_invites/invite_people') %>"); 
$("#content").show();
$(".welcome").hide();
// email widget stuff:
$.getScript("https://www.plaxo.com/ab_chooser/abc_comm.jsdyn", function(){
    //alert('Load was performed.');
});
$.getScript("http://www.plaxo.com/css/m/js/util.js", function(){
    //alert('Load was performed.');
});
$.getScript("http://www.plaxo.com/css/m/js/basic.js", function(){
    //alert('Load was performed.'); 
}); 
$.getScript("http://www.plaxo.com/css/m/js/abc_launcher.js", function(){
   // alert('Load was performed.');
});

email_invites/invite_people.html.erb contains

<a href="#" onclick="showPlaxoABChooser('recipient_list', '/'); return false"><img src="http://www.plaxo.com/images/abc/buttons/add_button.gif" alt="Add from my address book" /></a>
<br /> `
<%= form_tag send_email_invites_path, :remote => true do %>
  <%= text_area_tag "emails", @emails, :id => 'recipient_list' %>
  <%= submit_tag "Send invites!" %>
<% end %>

Where I think the problem is: The second argument to showPlaxoABChooser() is the absolute path to the callback page, which, since we're still on the root url, should be /, correct?

As it is currently, the user clicks "add from my address book" and is taken off of the site to select their contacts. After the user selects contacts, the widget is unable to hit our site back with a request containing their selected contacts (widget says to please wait forever).

I'd appreciate any help.


Solution

  • The url that plaxo hits when they return the email addresses to the app server needs to be different than the url that the widget is launched from.

    Works great!