[Facebooker-talk] fb_comments and fb_board not working

Allen Walker auswalk at gmail.com
Thu Sep 4 18:33:25 EDT 2008


Ok I still have a question if what you say is correct: I was able to get 
fb:board to work from /home/new  but not simply /home

Looking at my rake routes:

                POST   /home                            
{:action=>"create", :controller=>"home"}
                          POST   /home.:format                    
{:action=>"create", :controller=>"home"}
                 new_home GET    /home/new                        
{:action=>"new", :controller=>"home"}
       formatted_new_home GET    /home/new.:format                
{:action=>"new", :controller=>"home"}
                edit_home GET    /home/:id/edit                   
{:action=>"edit", :controller=>"home"}
      formatted_edit_home GET    /home/:id/edit.:format           
{:action=>"edit", :controller=>"home"}
                     home GET    /home/:id                        
{:action=>"show", :controller=>"home"}
           formatted_home GET    /home/:id.:format                
{:action=>"show", :controller=>"home"}
                          PUT    /home/:id                        
{:action=>"update", :controller=>"home"}
                          PUT    /home/:id.:format                
{:action=>"update", :controller=>"home"}
                          DELETE /home/:id                        
{:action=>"destroy", :controller=>"home"}
                          DELETE /home/:id.:format                
{:action=>"destroy", :controller=>"home"}
         discussion_board        /discussion                      
{:action=>"index", :controller=>"home"}

If you notice /home does support POST which posts to the "create" 
action. Whereas /home/new only supports GET from the rake routes 
information. Unless of course I'm reading it wrong. My only guess is if 
there is a specific RULE for a POST on a URL then it messes up b/c rails 
tries to intercept the POST before facebook can.

Mike Mangino wrote:
> Actually, you can
>
> map.fancy_name 'fancy_path/:id' ....
>
> Your problems were caused by Facebook sending a POST request to a URL 
> that doesn't support posts. When they try to do that, your application 
> returns an error and they cancel the posting. By creating a route by 
> hand, you are decoupling it from the HTTP method used.
>
> Mike
>
> On Sep 4, 2008, at 6:16 PM, Allen Walker wrote:
>
>> Also even though this works, i have urls that are dynamic , i.e. 
>> /articles/8 for example and want comments on those pages. That 
>> doesn't work. And I can't hardcode a route for a dynamic route that I 
>> know of really.
>>
>> 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
>>
>> _______________________________________________
>> 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