Joseph Durden
2008-Nov-10 23:21 UTC
[Facebooker-talk] Unusual Bebo invitations occurances???
hello,
I am using the updated facebooker with bebo support. I am running into
problems though using invitations with bebo. The problems I am running into
with bebo, when using the invitations new controller action with the
invitations/new.fbml.erb, and inside the new.fbml.erb file, calling
invitations_url within the fb_multi_friend_request does not recognize when
to call the invitations index action when pressing skip. Instead when
pressing skip, it calls the invitations/create action which causes errors.
here is the code I am using, and I should note it is from the Developing
facebook platform development with rails book.
class InvitationsController < PilotController
def index
redirect_to root_url
end
def new
if params[:from]
@sent_from_id = params[:from]
@user = facebook_session.user
@user.profile_fbml = render_to_string(:partial=>"profile" ,
:locals=>{:from=>params[:from]})
end
@from_user_id = facebook_session.user.to_s
end
def create
@sent_to_ids = params[:ids]
end
end
app/views/invitations/new.fbml.erb
<% fb_multi_friend_request("Test this app" ,
"Invite your friends to test this app" ,
invitations_url) do %>
Test this app with your friends!
<%= fb_req_choice("Test this app!" ,
root_url(:from=>@from_user_id, :canvas=>true))%>
<% end %>
app/views/invitations/create.fbml.erb
<% for id in @sent_to_ids%>
<%= fb_profile_pic id %> <%= fb_name id %><br />
<% end %>
app/views/invitations/_profile.fbml.erb
<% if @sent_from_id %>
I was sent here by <fb:name uid=''<%= @sent_from_id
%>'' /><br />
<% end %>
I am <fb:name uid=''<%= current_user.facebook_id %>''
/><br />
The following errors exist when following this flow of events: After
navigating to invitations/new and pressing skip, for some reason bebo tries
to call the create method and tries to set @sent_to_ids, even though it
should be recognizing the index action. When performing this in facebook,
everything works as expected and after clicking skip, the user is redirected
to the invitations index action. Here are the errors when doing this in
bebo:
NoMethodError in Invitations#create
Showing invitations/create.fbml.erb where line #1 raised:
You have a nil object when you didn''t expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.each
Extracted source (around line #1):
1: <% for id in @sent_to_ids%>
2: <= fb_profile_pic id %> <= fb_name id >
3: < end %>
?-?-?-?-?-?
I am also receiving problems during this flow of events as well. Navigate to
the invite page, select users to invite, followed by deselecting all of the
users, then clicking skip. When the skip action is performed, for some
reason the params[:ids] have been stored and the create action is called,
showing the create.fbml.erb page with a list of users that have been
selected, even though skip was called. The invitation is not sent though.
Basically pressing skip in bebo calls the create action and stores any
selected and deselected users in the @sent_to_ids variable, even though it
should be calling the index action.
What is the best way to handle this inconsistency so pressing skip works as
expected when using bebo, so it recognizes that skip should route to
invitations/index action? Is there another api call rather than the
fb_multi_friend_request where I could explicitly define when pressing skip,
or pressing invite? How have others handled this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/facebooker-talk/attachments/20081110/2c955cc4/attachment.html>
David Clements
2008-Nov-11 16:29 UTC
[Facebooker-talk] Unusual Bebo invitations occurances???
Not sure if this will help but I have had to special case the invite page. I am not remembering why but I have this code. <fb:request-form action="<%= bebo_request? ? "social_network/dashboard" : "dashboard" %>" I am running on facebook and bebo. Dave On Mon, Nov 10, 2008 at 4:21 PM, Joseph Durden <josephdurden at gmail.com>wrote:> hello, > > I am using the updated facebooker with bebo support. I am running into > problems though using invitations with bebo. The problems I am running into > with bebo, when using the invitations new controller action with the > invitations/new.fbml.erb, and inside the new.fbml.erb file, calling > invitations_url within the fb_multi_friend_request does not recognize when > to call the invitations index action when pressing skip. Instead when > pressing skip, it calls the invitations/create action which causes errors. > here is the code I am using, and I should note it is from the Developing > facebook platform development with rails book. > > class InvitationsController < PilotController > > def index > redirect_to root_url > end > > def new > if params[:from] > @sent_from_id = params[:from] > @user = facebook_session.user > @user.profile_fbml = render_to_string(:partial=>"profile" , > :locals=>{:from=>params[:from]}) > end > @from_user_id = facebook_session.user.to_s > end > > def create > @sent_to_ids = params[:ids] > end > end > app/views/invitations/new.fbml.erb > > <% fb_multi_friend_request("Test this app" , > "Invite your friends to test this app" , > invitations_url) do %> > Test this app with your friends! > <%= fb_req_choice("Test this app!" , > root_url(:from=>@from_user_id, :canvas=>true))%> > <% end %> > > app/views/invitations/create.fbml.erb > > <% for id in @sent_to_ids%> > <%= fb_profile_pic id %> <%= fb_name id %><br /> > <% end %> > > app/views/invitations/_profile.fbml.erb > <% if @sent_from_id %> > I was sent here by <fb:name uid=''<%= @sent_from_id %>'' /><br /> > <% end %> > I am <fb:name uid=''<%= current_user.facebook_id %>'' /><br /> > > The following errors exist when following this flow of events: After > navigating to invitations/new and pressing skip, for some reason bebo tries > to call the create method and tries to set @sent_to_ids, even though it > should be recognizing the index action. When performing this in facebook, > everything works as expected and after clicking skip, the user is redirected > to the invitations index action. Here are the errors when doing this in > bebo: > > NoMethodError in Invitations#create > > Showing invitations/create.fbml.erb where line #1 raised: > > You have a nil object when you didn''t expect it! > You might have expected an instance of Array. > The error occurred while evaluating nil.each > > Extracted source (around line #1): > > 1: <% for id in @sent_to_ids%> > 2: <= fb_profile_pic id %> <= fb_name id > > 3: < end %> > > ?-?-?-?-?-? > > I am also receiving problems during this flow of events as well. Navigate > to the invite page, select users to invite, followed by deselecting all of > the users, then clicking skip. When the skip action is performed, for some > reason the params[:ids] have been stored and the create action is called, > showing the create.fbml.erb page with a list of users that have been > selected, even though skip was called. The invitation is not sent though. > > Basically pressing skip in bebo calls the create action and stores any > selected and deselected users in the @sent_to_ids variable, even though it > should be calling the index action. > > What is the best way to handle this inconsistency so pressing skip works as > expected when using bebo, so it recognizes that skip should route to > invitations/index action? Is there another api call rather than the > fb_multi_friend_request where I could explicitly define when pressing skip, > or pressing invite? How have others handled this? > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20081111/bf8390c2/attachment-0001.html>