[Facebooker-talk] fb_comments and fb_board not working

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


Tried that tag specifically. Couldn't get it to work. Same deal. The 
discussion board comes up but when I enter a topic and data and click 
POST, nothing is populated.

I have to believe the HTTP POST is not being routed correctly and 
therefore the POST data is lost. I think therefore my routing is not 
setup correctly to handle this. Please note fb:board is being used on 
the "home" controller view  .. i.e. apps.facebook.com/myapp/home   in 
app/views/home/index.fbml.erb

Here's my routes.rb:

ActionController::Routing::Routes.draw do |map|
  # The priority is based upon order of creation: first created -> 
highest priority.

  # Sample of regular route:
  #   map.connect 'products/:id', :controller => 'catalog', :action => 
'view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   map.purchase 'products/:id/purchase', :controller => 'catalog', 
:action => 'purchase'
  # This route can be invoked with purchase_url(:id => product.id)

  # Sample resource route (maps HTTP verbs to controller actions 
automatically):
  #   map.resources :products

  # Sample resource route with options:
  #   map.resources :products, :member => { :short => :get, :toggle => 
:post }, :collection => { :sold => :get }

  # Sample resource route with sub-resources:
  #   map.resources :products, :has_many => [ :comments, :sales ], 
:has_one => :seller

  # Sample resource route with more complex sub-resources
  #   map.resources :products do |products|
  #     products.resources :comments
  #     products.resources :sales, :collection => { :recent => :get }
  #   end

  # Sample resource route within a namespace:
  #   map.namespace :admin do |admin|
  #     # Directs /admin/products/* to Admin::ProductsController 
(app/controllers/admin/products_controller.rb)
  #     admin.resources :products
  #   end

  # You can have the root of your site routed with map.root -- just 
remember to delete public/index.html.
  # map.root :controller => "welcome"

  # See how all your routes lay out with "rake routes"


  map.resources :invitations
  map.resources :sports
  map.resources :home


#  map.root :controller=>"home", :action=>"index"

  # Install the default routes as the lowest priority.
  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'
end

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
>
>
>
>



More information about the Facebooker-talk mailing list