[Facebooker-talk] fb_comments and fb_board not working

Allen Walker auswalk at gmail.com
Thu Sep 4 17:56:17 EDT 2008


That worked! Man I am confused on this routing stuff and I'm really lost 
as to why this works and it doesn't work the default way.

Mike Mangino wrote:
> Try creating a route just for that page, i.e.
>
> route.discussion_board 'discussion', :controller=>"home", 
> :action=>"index"
>
> Then, go to http://apps.new.facebook.com/myapp/discussion and see if 
> that works.
>
> I struggled like mad to get this to work the first time too. I wish I 
> could remember the eventual fix.
>
> Mike
>
> On Sep 4, 2008, at 5:28 PM, Allen Walker wrote:
>
>> Interesting. I was able to get the fb:board to work properly when 
>> added a "new" action to my home controller. Then I created new.fbml.erb:
>>
>> <fb:board xid="titans_board" canpost="true" candelete="false" 
>> canmark="false" cancreatetopic="true" numtopics="5" 
>> returnurl="http://apps.facebook.com/myapp/home/"> <fb:title>Discuss 
>> the Titans</fb:title> </fb:board>
>>
>> Went to http://apps.new.facebook.com/myapp/home/new
>>
>> Created a topic, hit post and it saved it.
>>
>> Then on my home page the saved topic now appears in the list, but 
>> once again if I try to create a new topic from this page , nothing is 
>> populated. It only works when I go to 
>> http://apps.new.facebook.com/myapp/home/new  and then create and post 
>> of topic from that page
>>
>> Bizarre. Any ideas
>>
>> Mike Mangino wrote:
>>> Have you tried the absolute basics?
>>>
>>> <fb:board xid="titans_board" canpost="true" candelete="false" 
>>> canmark="false" cancreatetopic="true" numtopics="5" 
>>> returnurl="http://apps.facebook.com/myapp/titans/"> 
>>> <fb:title>Discuss the Titans</fb:title> </fb:board>
>>>
>>> and stick that on a static html page?
>>>
>>> If that works, try it with a rails page with a specific route to 
>>> make sure all http methods can hit it.
>>>
>>> We're using the board tag with success.
>>>
>>> Mike
>>>
>>> On Sep 4, 2008, at 1:23 PM, Allen Walker wrote:
>>>
>>>> Well it has to somehow resolve ambiguities at least at an 
>>>> application level.
>>>>
>>>> Again for some reason this isn't working properly. Maybe someone 
>>>> else who's using these tags would chime in.
>>>>
>>>> David Clements wrote:
>>>>> Yeah, I would think that it would do this.
>>>>>
>>>>>
>>>>> Dave
>>>>>
>>>>> On Thu, Sep 4, 2008 at 11:00 AM, Allen Walker <auswalk at gmail.com 
>>>>> <mailto:auswalk at gmail.com>> wrote:
>>>>>
>>>>>   Hmm. well what if you used the same xid on different pages. I
>>>>>   wouldn't think it would pull in the comments from  the other page
>>>>>   right?
>>>>>
>>>>>   On Thu, Sep 4, 2008 at 11:56 AM, David Clements
>>>>>   <digidigo at gmail.com <mailto:digidigo at gmail.com>> wrote:
>>>>>
>>>>>       Not sure about that.  I don't set the url in the tutorial at
>>>>>       all.  Each lesson has it own comment block with just and xid.
>>>>>
>>>>>       Dave
>>>>>
>>>>>
>>>>>
>>>>>       On Thu, Sep 4, 2008 at 10:53 AM, Allen Walker
>>>>>       <auswalk at gmail.com <mailto:auswalk at gmail.com>> wrote:
>>>>>
>>>>>           Yeah I've looked at that tutorial. It's very
>>>>>           straightforward and I've tried it as it says with no luck.
>>>>>           I've gotten everything else to work so i'm quite puzzled.
>>>>>           It must have something to do with routing and url
>>>>>           recognition is the only thing I can figure, as I believe
>>>>>           the fb:board and fb:comments tag map based on the URL and
>>>>>           the xid=value.
>>>>>
>>>>>
>>>>>           On Thu, Sep 4, 2008 at 11:09 AM, David Clements
>>>>>           <digidigo at gmail.com <mailto:digidigo at gmail.com>> wrote:
>>>>>
>>>>>               Not totally sure what your issues are but did you look
>>>>>               at the comments section on the facebooker tutorial.
>>>>>
>>>>>               They appear to be working there, although in there
>>>>>               simplest form.
>>>>>
>>>>>               
>>>>> http://apps.new.facebook.com/facebooker_tutorial/fbml/comments
>>>>>
>>>>>               I haven't tried the board yet though.
>>>>>
>>>>>
>>>>>
>>>>>               Dave
>>>>>
>>>>>
>>>>>               On Thu, Sep 4, 2008 at 9:52 AM, Zhao Lu <zhao.lu.us
>>>>>               <http://zhao.lu.us>@gmail.com <http://gmail.com>> 
>>>>> wrote:
>>>>>
>>>>>                   Hmm that shouldn't be the case.  I had to
>>>>>                   internally store the comments
>>>>>                   because I wanted to be able to search them.  As
>>>>>                   far as discussion board
>>>>>                   goes, I'd really love to use the fbml rather than
>>>>>                   implementing it.
>>>>>
>>>>>                   Since I'm new to this whole rails thing, all I can
>>>>>                   think of is to look at the
>>>>>                   test cases (rails app should be well tested,
>>>>>                   right?).  I found a bunch
>>>>>                   of tests under
>>>>>                   vendor/plugins/facebooker/test/.
>>>>>                    rails_integration_test.rb
>>>>>                   contains some test cases on comments and fb_board.
>>>>>                    I was hoping to figure
>>>>>                   out the usage of them by merely looking at the
>>>>>                   test case.  I'm not sure if
>>>>>                   you've looked at those and if they're helpful to 
>>>>> you.
>>>>>                   I figured if they aren't then it means the test
>>>>>                   coverage can be improved.  So
>>>>>                   you (or facebooker users like us) could probably
>>>>>                   improve it by adding new test
>>>>>                   cases, which should also help with debugging our
>>>>>                   problems as well.
>>>>>
>>>>>                   Zhao
>>>>>
>>>>>                   On Thu, Sep 4, 2008 at 12:02 AM, Allen Walker
>>>>>                   <auswalk at gmail.com <mailto:auswalk at gmail.com>> 
>>>>> wrote:
>>>>>                   > Sadly, to do comments I had to implement what
>>>>>                   you have done, which
>>>>>                   > theoretically is much harder than just using the
>>>>>                   built in facebook comments
>>>>>                   > tag. Now that I wish to use a discussion board,
>>>>>                   it really behooves me to
>>>>>                   > figure this out b/c a discussion board is much
>>>>>                   more advanced than just
>>>>>                   > comments.
>>>>>                   >
>>>>>                   > Zhao Lu wrote:
>>>>>                   >>
>>>>>                   >> you are ahead of me, again.
>>>>>                   >>
>>>>>                   >> On Wed, Sep 3, 2008 at 10:46 PM, Allen Walker
>>>>>                   <auswalk at gmail.com <mailto:auswalk at gmail.com>> 
>>>>> wrote:
>>>>>                   >>
>>>>>                   >>>
>>>>>                   >>> Actually I'm not even doing that. You are
>>>>>                   internally storing you own
>>>>>                   >>> comments.
>>>>>                   >>>
>>>>>                   >>> I'm simply attempting to use facebooks built
>>>>>                   in servers to run my
>>>>>                   >>> dicussion
>>>>>                   >>> boards and comments via the <fb:board> and
>>>>>                   <fb:comments> code. It should
>>>>>                   >>> be
>>>>>                   >>> rather trivial and for some reason it's not
>>>>>                   working. It must have
>>>>>                   >>> something
>>>>>                   >>> to do with how facebook is reading the URL and
>>>>>                   not correctly mapping it
>>>>>                   >>> to
>>>>>                   >>> the xid.
>>>>>                   >>>
>>>>>                   >>> Zhao Lu wrote:
>>>>>                   >>>
>>>>>                   >>>>
>>>>>                   >>>> I haven't tried fb_board but I did get
>>>>>                   fb_comment working.  The
>>>>>                   >>>> instruction in the beta _book_ wasn't quite
>>>>>                   >>>> complete and I had to look at the source code
>>>>>                   for chapter 8 to get
>>>>>                   >>>> things working.  I had the same problem
>>>>>                   >>>> with you (or at least I think it's the same
>>>>>                   problem).  Basically I
>>>>>                   >>>> type some comment in the text area and click
>>>>>                   >>>> submit and nothing 'happens'.  When I look
>>>>>                   into the database table the
>>>>>                   >>>> new comment is there so what I was
>>>>>                   >>>> missing was to pull the comments out from the
>>>>>                   table and display them.
>>>>>                   >>>>
>>>>>                   >>>> My code structure is pretty much the same as
>>>>>                   karate poke.  I have this
>>>>>                   >>>> code snippet in my view:
>>>>>                   >>>>
>>>>>                   >>>> <% form_for Comment.new do %>
>>>>>                   >>>>  Comment on gifts: <br />
>>>>>                   >>>>  <%= text_area_tag :body %> <br />
>>>>>                   >>>>  <%= hidden_field_tag :comment_receiver,
>>>>>                   @user.id <http://user.id> %>
>>>>>                   >>>>  <%= submit_tag 'Post' %>
>>>>>                   >>>> <% end %>
>>>>>                   >>>>
>>>>>                   >>>> <div id="all_comments">
>>>>>                   >>>>  <%= render :partial=>"comments/comments" %>
>>>>>                   >>>> </div>
>>>>>                   >>>>
>>>>>                   >>>> I was missing the <div>...</div> portion
>>>>>                   before.  Do you have that and
>>>>>                   >>>> the _comments.erb partial in place?
>>>>>                   >>>>
>>>>>                   >>>> Zhao
>>>>>                   >>>>
>>>>>                   >>>> On Wed, Sep 3, 2008 at 9:37 PM, Allen Walker
>>>>>                   <auswalk at gmail.com <mailto:auswalk at gmail.com>> 
>>>>> wrote:
>>>>>                   >>>>
>>>>>                   >>>>
>>>>>                   >>>>>
>>>>>                   >>>>> It would sure be nice if these would work.
>>>>>                   >>>>>
>>>>>                   >>>>> I have the following in my home controller:
>>>>>                   >>>>>
>>>>>                   >>>>> <%= fb_board("golf_board1") %>
>>>>>                   >>>>>
>>>>>                   >>>>> it renders:
>>>>>                   >>>>>
>>>>>                   >>>>> <fb:board xid="golf_board1" />
>>>>>                   >>>>>
>>>>>                   >>>>> The discussion board shows on my page, but
>>>>>                   when I click start new
>>>>>                   >>>>> topic,
>>>>>                   >>>>> it
>>>>>                   >>>>> reloads the previous URL (default callback)
>>>>>                   and continues to display
>>>>>                   >>>>> "Start
>>>>>                   >>>>> new topic".
>>>>>                   >>>>>
>>>>>                   >>>>> fb_comments does the same thing.
>>>>>                   >>>>>
>>>>>                   >>>>>
>>>>>                   >>>>> Btw my URL is this after clicking "start new
>>>>>                   topic"
>>>>>                   >>>>>
>>>>>                   >>>>> 
>>>>> http://apps.new.facebook.com/myapp/?fbapp_ec=751
>>>>>                   >>>>>
>>>>>                   >>>>> thanks
>>>>>                   >>>>> 
>>>>> _______________________________________________
>>>>>                   >>>>>
>>>>>                   >>>>>
>>>>>                   >
>>>>>                   > _______________________________________________
>>>>>                   > Facebooker-talk mailing list
>>>>>                   > Facebooker-talk at rubyforge.org
>>>>>                   <mailto:Facebooker-talk at rubyforge.org>
>>>>>                   >
>>>>>                   
>>>>> http://rubyforge.org/mailman/listinfo/facebooker-talk
>>>>>                   >
>>>>>
>>>>>
>>>>>
>>>>>                   --
>>>>>                   Zhao
>>>>>                   _______________________________________________
>>>>>                   Facebooker-talk mailing list
>>>>>                   Facebooker-talk at rubyforge.org
>>>>>                   <mailto:Facebooker-talk at rubyforge.org>
>>>>>                   
>>>>> http://rubyforge.org/mailman/listinfo/facebooker-talk
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>           --             http://auswalk.blogspot.com
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>   --     http://auswalk.blogspot.com
>>>>>
>>>>>   _______________________________________________
>>>>>   Facebooker-talk mailing list
>>>>>   Facebooker-talk at rubyforge.org 
>>>>> <mailto:Facebooker-talk at rubyforge.org>
>>>>>   http://rubyforge.org/mailman/listinfo/facebooker-talk
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> Facebooker-talk mailing list
>>>> Facebooker-talk at rubyforge.org
>>>> http://rubyforge.org/mailman/listinfo/facebooker-talk
>>>
>>> -- 
>>> Mike Mangino
>>> http://www.elevatedrails.com
>>>
>>>
>>>
>>>
>>
>> _______________________________________________
>> Facebooker-talk mailing list
>> Facebooker-talk at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/facebooker-talk
>
> -- 
> Mike Mangino
> http://www.elevatedrails.com
>
>
>
>



More information about the Facebooker-talk mailing list