0

I've been using the following gem for facebook inttegration in my rails app - https://github.com/dekart/facebooker2.git

I've had a few issues with it , so I've decided to try and upgrade to the latest version of the main facebooker gem. - https://github.com/mmangino/facebooker2.git

My issue is that I can't seem to do callbacks with the new gem previously I could do something like this -

   <%= fb_login(:text=>t('my_text')) do %>
          $("#myForm").submit();
          top.location.href='<%= APP_CONFIG[:somewhere] %>';
   <% end %>

It's not working in the new gem and I can't see how to do it in the docs.

Is it possible to do a javascript callback with the new facebooker2 gem?


I've managed to get the js working by doing this -

    <%- fb_login { concat " $('#myForm').submit();" }%> 

however I can't seem to add text. This throws an error -

  <%- fb_login :text=>t('my text'), { concat " $('#myForm').submit();" }%> 

I'm sure this is just a syntax thing. Anyone see what I'm doing wrong?

Finnnn
  • 3,530
  • 6
  • 46
  • 69

1 Answers1

0

Try using a scriplet instead of an expression in the first line:

<% fb_login(:text=>t('my_text')) do %>
      $("#myForm").submit();
      top.location.href='<%= APP_CONFIG[:somewhere] %>';
<% end %>
gparis
  • 1,247
  • 12
  • 32
  • I spoke too soon that seems to render everything twice for some reason. I get 2 facebook login buttons rendering. – Finnnn Dec 22 '11 at 09:55