Here''s the fix for Facebook apps that specify a controller in their callback URLs. First, set this variable in your environment scripts: ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' # where controller is the name of your Facebook controller And then patch vendor/plugins/facebooker/lib/facebooker/rails/facebook_url_rewriting.rb as shown in the attached diff. Please let me know if you encounter any issues with this patch. Thanks, Shawn -------------- next part -------------- A non-text attachment was scrubbed... Name: diff.out Type: application/octet-stream Size: 750 bytes Desc: not available Url : http://rubyforge.org/pipermail/facebooker-talk/attachments/20080128/07cf36dd/attachment.obj
Or you could do: map.connect ''/sandboxed_controller/ sandboxed_controller/:action/:id, :controller => ''sandboxed_controller'' where sandboxed_controller is the name of the controller you want to sandbox Michael Niessner On Jan 28, 2008, at 9:52 PM, Shawn Van Ittersum wrote:> Here''s the fix for Facebook apps that specify a controller in their > callback URLs. First, set this variable in your environment scripts: > > ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' > # where controller is the name of your Facebook controller > > And then patch vendor/plugins/facebooker/lib/facebooker/rails/ > facebook_url_rewriting.rb as shown in the attached diff. > > Please let me know if you encounter any issues with this patch. > > Thanks, > Shawn > <diff.out>_______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk
The correct way to handle this case is to make sure the link URLs are composed correctly in the first place, not to add routing to resolve bad links. Facebooker already includes URL rewriting code; I''ve merely modified it to generate correct links for the sandbox controller case. Thanks, Shawn On Tue, 29 Jan 2008 10:14:22 -0600, Michael Niessner wrote:> Or you could do: > map.connect ''/sandboxed_controller/sandboxed_controller/:action/:id, > :controller => ''sandboxed_controller'' > where sandboxed_controller is the name of the controller you want to sandbox > > Michael Niessner > > On Jan 28, 2008, at 9:52 PM, Shawn Van Ittersum wrote: > >> Here''s the fix for Facebook apps that specify a controller in their >> callback URLs. First, set this variable in your environment scripts: >> >> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' >> # where controller is the name of your Facebook controller >> >> And then patch >> vendor/plugins/facebooker/lib/facebooker/rails/facebook_url_rewriting.rb >> as shown in the attached diff. >> >> Please let me know if you encounter any issues with this patch. >> >> Thanks, >> Shawn >> <diff.out>_______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >
I strongly disagree. Your approach leads to the very poor design decision of placing all facebook actions in a single controller. By using routing you can use multiple controllers in a sandboxed environment. Set your callback_url on facebook to http://yourhost.com/yourapp/sandbox/ Then add the following routes map.connect ''/sandbox/controller_1/:action/:id'', :controller => ''controller_1'' map.connect ''/sandbox/controller_2/:action/:id'', :controller => ''controller_2'' I don''t think adding code to facebooker to achieve a limited subset of the functionality that can be obtained by using rails routes is the "correct way" to handle this case. Michael Niessner On Jan 29, 2008, at 11:19 AM, Shawn Van Ittersum wrote:> The correct way to handle this case is to make sure the link URLs > are composed correctly in the first place, not to add routing to > resolve bad links. Facebooker already includes URL rewriting code; > I''ve merely modified it to generate correct links for the sandbox > controller case. > > Thanks, > Shawn > > On Tue, 29 Jan 2008 10:14:22 -0600, Michael Niessner wrote: >> Or you could do: >> map.connect ''/sandboxed_controller/sandboxed_controller/:action/:id, >> :controller => ''sandboxed_controller'' >> where sandboxed_controller is the name of the controller you want >> to sandbox >> >> Michael Niessner >> >> On Jan 28, 2008, at 9:52 PM, Shawn Van Ittersum wrote: >> >>> Here''s the fix for Facebook apps that specify a controller in their >>> callback URLs. First, set this variable in your environment >>> scripts: >>> >>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' >>> # where controller is the name of your Facebook controller >>> >>> And then patch >>> vendor/plugins/facebooker/lib/facebooker/rails/ >>> facebook_url_rewriting.rb >>> as shown in the attached diff. >>> >>> Please let me know if you encounter any issues with this patch. >>> >>> Thanks, >>> Shawn >>> <diff.out>_______________________________________________ >>> 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/20080129/e5b491e0/attachment.html
Actually, the implementation of your patch is probably correct. It''s just the intent that is all wrong. If you change ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' to ENV[''FACEBOOKER_SANDBOX_NAMESPACE''] = ''/namespace'' You get the benefits of multiple controllers without having to add a route for each one. Additionally you can take advantage of all the goodness that is map.resources. Also a unit test would be a nice addition to your patch. Michael Niessner On Jan 29, 2008, at 11:30 AM, Michael Niessner wrote:> I strongly disagree. Your approach leads to the very poor design > decision of placing all facebook actions in a single controller. By > using routing you can use multiple controllers in a sandboxed > environment. > > Set your callback_url on facebook to > http://yourhost.com/yourapp/sandbox/ > Then add the following routes > map.connect ''/sandbox/controller_1/:action/:id'', :controller => > ''controller_1'' > map.connect ''/sandbox/controller_2/:action/:id'', :controller => > ''controller_2'' > > I don''t think adding code to facebooker to achieve a limited subset > of the functionality that can be obtained by using rails routes is > the "correct way" to handle this case. > > Michael Niessner > > On Jan 29, 2008, at 11:19 AM, Shawn Van Ittersum wrote: > >> The correct way to handle this case is to make sure the link URLs >> are composed correctly in the first place, not to add routing to >> resolve bad links. Facebooker already includes URL rewriting code; >> I''ve merely modified it to generate correct links for the sandbox >> controller case. >> >> Thanks, >> Shawn >> >> On Tue, 29 Jan 2008 10:14:22 -0600, Michael Niessner wrote: >>> Or you could do: >>> map.connect ''/sandboxed_controller/sandboxed_controller/:action/:id, >>> :controller => ''sandboxed_controller'' >>> where sandboxed_controller is the name of the controller you want >>> to sandbox >>> >>> Michael Niessner >>> >>> On Jan 28, 2008, at 9:52 PM, Shawn Van Ittersum wrote: >>> >>>> Here''s the fix for Facebook apps that specify a controller in their >>>> callback URLs. First, set this variable in your environment >>>> scripts: >>>> >>>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' >>>> # where controller is the name of your Facebook controller >>>> >>>> And then patch >>>> vendor/plugins/facebooker/lib/facebooker/rails/ >>>> facebook_url_rewriting.rb >>>> as shown in the attached diff. >>>> >>>> Please let me know if you encounter any issues with this patch. >>>> >>>> Thanks, >>>> Shawn >>>> <diff.out>_______________________________________________ >>>> 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/20080129/900a1d0d/attachment.html
Hi Michael, I agree with you about namespaces. To be clear, my example code was only one possible implementation. My patch is not intended to force sandboxing to one controller only, but rather to any namespace desired by the developer. I would still like to keep the config variable named FACEBOOKER_CALLBACK_PATH, as it relates directly to the Facebook callback URL setting. So to update the example: ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/namespace'' # where Facebook Developer callback url = http://yourserver.com:port/namespace Shawn On Tue, 29 Jan 2008 12:44:14 -0600, Michael Niessner wrote:> Actually, the implementation of your patch is probably correct. It''s > just the intent that is all wrong. If you change > > ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' to > ENV[''FACEBOOKER_SANDBOX_NAMESPACE''] = ''/namespace'' > > You get the benefits of multiple controllers without having to add a > route for each one. Additionally you can take advantage of all the > goodness that is map.resources. > > Also a unit test would be a nice addition to your patch. > > Michael Niessner > > > On Jan 29, 2008, at 11:30 AM, Michael Niessner wrote: >> I strongly disagree. Your approach leads to the very poor design >> decision of placing all facebook actions in a single controller. By >> using routing you can use multiple controllers in a sandboxed >> environment. >> >> Set your callback_url on facebook to >> http://yourhost.com/yourapp/sandbox/ >> Then add the following routes >> map.connect ''/sandbox/controller_1/:action/:id'', :controller => >> ''controller_1'' >> map.connect ''/sandbox/controller_2/:action/:id'', :controller => >> ''controller_2'' >> >> I don''t think adding code to facebooker to achieve a limited subset >> of the functionality that can be obtained by using rails routes is >> the "correct way" to handle this case. >> >> Michael Niessner >> >> On Jan 29, 2008, at 11:19 AM, Shawn Van Ittersum wrote: >>> The correct way to handle this case is to make sure the link URLs >>> are composed correctly in the first place, not to add routing to >>> resolve bad links. Facebooker already includes URL rewriting code; >>> I''ve merely modified it to generate correct links for the sandbox >>> controller case. >>> >>> Thanks, >>> Shawn >>> >>> On Tue, 29 Jan 2008 10:14:22 -0600, Michael Niessner wrote: >>>> Or you could do: >>>> map.connect ''/sandboxed_controller/sandboxed_controller/:action/:id, >>>> :controller => ''sandboxed_controller'' >>>> where sandboxed_controller is the name of the controller you want >>>> to sandbox >>>> >>>> Michael Niessner >>>> >>>> On Jan 28, 2008, at 9:52 PM, Shawn Van Ittersum wrote: >>>> >>>>> Here''s the fix for Facebook apps that specify a controller in their >>>>> callback URLs. First, set this variable in your environment scripts: >>>>> >>>>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' >>>>> # where controller is the name of your Facebook controller >>>>> >>>>> And then patch >>>>> vendor/plugins/facebooker/lib/facebooker/rails/facebook_url_rewriting.rb >>>>> as shown in the attached diff. >>>>> >>>>> Please let me know if you encounter any issues with this patch. >>>>> >>>>> Thanks, >>>>> Shawn >>>>> <diff.out>_______________________________________________ >>>>> Facebooker-talk mailing list >>>>> Facebooker-talk at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>> >> >
I feel mixed about the name. I like that callback_path translates to the path component of your callback url. I like that sandbox_namespace signals an intention to sandbox the app using a namespace, providing guidance of how to use the setting. I prefer whichever name people would have an easier time understanding. Maybe a few others on the list could chime in? Michael Niessner On Jan 29, 2008, at 1:20 PM, Shawn Van Ittersum wrote:> Hi Michael, > > I agree with you about namespaces. To be clear, my example code was > only one possible implementation. My patch is not intended to force > sandboxing to one controller only, but rather to any namespace > desired by the developer. I would still like to keep the config > variable named FACEBOOKER_CALLBACK_PATH, as it relates directly to > the Facebook callback URL setting. So to update the example: > > ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/namespace'' > # where Facebook Developer callback url = http://yourserver.com:port/ > namespace > > Shawn > > On Tue, 29 Jan 2008 12:44:14 -0600, Michael Niessner wrote: >> Actually, the implementation of your patch is probably correct. It''s >> just the intent that is all wrong. If you change >> >> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' to >> ENV[''FACEBOOKER_SANDBOX_NAMESPACE''] = ''/namespace'' >> >> You get the benefits of multiple controllers without having to add a >> route for each one. Additionally you can take advantage of all the >> goodness that is map.resources. >> >> Also a unit test would be a nice addition to your patch. >> >> Michael Niessner >> >> >> On Jan 29, 2008, at 11:30 AM, Michael Niessner wrote: >>> I strongly disagree. Your approach leads to the very poor design >>> decision of placing all facebook actions in a single controller. By >>> using routing you can use multiple controllers in a sandboxed >>> environment. >>> >>> Set your callback_url on facebook to >>> http://yourhost.com/yourapp/sandbox/ >>> Then add the following routes >>> map.connect ''/sandbox/controller_1/:action/:id'', :controller => >>> ''controller_1'' >>> map.connect ''/sandbox/controller_2/:action/:id'', :controller => >>> ''controller_2'' >>> >>> I don''t think adding code to facebooker to achieve a limited subset >>> of the functionality that can be obtained by using rails routes is >>> the "correct way" to handle this case. >>> >>> Michael Niessner >>> >>> On Jan 29, 2008, at 11:19 AM, Shawn Van Ittersum wrote: >>>> The correct way to handle this case is to make sure the link URLs >>>> are composed correctly in the first place, not to add routing to >>>> resolve bad links. Facebooker already includes URL rewriting code; >>>> I''ve merely modified it to generate correct links for the sandbox >>>> controller case. >>>> >>>> Thanks, >>>> Shawn >>>> >>>> On Tue, 29 Jan 2008 10:14:22 -0600, Michael Niessner wrote: >>>>> Or you could do: >>>>> map.connect ''/sandboxed_controller/ >>>>> sandboxed_controller/:action/:id, >>>>> :controller => ''sandboxed_controller'' >>>>> where sandboxed_controller is the name of the controller you want >>>>> to sandbox >>>>> >>>>> Michael Niessner >>>>> >>>>> On Jan 28, 2008, at 9:52 PM, Shawn Van Ittersum wrote: >>>>> >>>>>> Here''s the fix for Facebook apps that specify a controller in >>>>>> their >>>>>> callback URLs. First, set this variable in your environment >>>>>> scripts: >>>>>> >>>>>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' >>>>>> # where controller is the name of your Facebook controller >>>>>> >>>>>> And then patch >>>>>> vendor/plugins/facebooker/lib/facebooker/rails/ >>>>>> facebook_url_rewriting.rb >>>>>> as shown in the attached diff. >>>>>> >>>>>> Please let me know if you encounter any issues with this patch. >>>>>> >>>>>> Thanks, >>>>>> Shawn >>>>>> <diff.out>_______________________________________________ >>>>>> Facebooker-talk mailing list >>>>>> Facebooker-talk at rubyforge.org >>>>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>>> >>> >>
I think that CALLBACK_PATH is the clearer variable name for the reason you mentioned, and that we should explain the namespace use of this variable in the documentation, with a couple examples. I''m happy to cover that as we build out the docs, which are in progress. Shawn On Tue, 29 Jan 2008 13:59:26 -0600, Michael Niessner wrote:> I feel mixed about the name. I like that callback_path translates to > the path component of your callback url. I like that > sandbox_namespace signals an intention to sandbox the app using a > namespace, providing guidance of how to use the setting. I prefer > whichever name people would have an easier time understanding. Maybe > a few others on the list could chime in? > > Michael Niessner > > On Jan 29, 2008, at 1:20 PM, Shawn Van Ittersum wrote: > >> Hi Michael, >> >> I agree with you about namespaces. To be clear, my example code was >> only one possible implementation. My patch is not intended to force >> sandboxing to one controller only, but rather to any namespace >> desired by the developer. I would still like to keep the config >> variable named FACEBOOKER_CALLBACK_PATH, as it relates directly to >> the Facebook callback URL setting. So to update the example: >> >> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/namespace'' >> # where Facebook Developer callback url = >> http://yourserver.com:port/namespace >> >> Shawn >> >> On Tue, 29 Jan 2008 12:44:14 -0600, Michael Niessner wrote: >>> Actually, the implementation of your patch is probably correct. It''s >>> just the intent that is all wrong. If you change >>> >>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' to >>> ENV[''FACEBOOKER_SANDBOX_NAMESPACE''] = ''/namespace'' >>> >>> You get the benefits of multiple controllers without having to add a >>> route for each one. Additionally you can take advantage of all the >>> goodness that is map.resources. >>> >>> Also a unit test would be a nice addition to your patch. >>> >>> Michael Niessner >>> >>> >>> On Jan 29, 2008, at 11:30 AM, Michael Niessner wrote: >>>> I strongly disagree. Your approach leads to the very poor design >>>> decision of placing all facebook actions in a single controller. By >>>> using routing you can use multiple controllers in a sandboxed >>>> environment. >>>> >>>> Set your callback_url on facebook to >>>> http://yourhost.com/yourapp/sandbox/ >>>> Then add the following routes >>>> map.connect ''/sandbox/controller_1/:action/:id'', :controller => >>>> ''controller_1'' >>>> map.connect ''/sandbox/controller_2/:action/:id'', :controller => >>>> ''controller_2'' >>>> >>>> I don''t think adding code to facebooker to achieve a limited subset >>>> of the functionality that can be obtained by using rails routes is >>>> the "correct way" to handle this case. >>>> >>>> Michael Niessner >>>> >>>> On Jan 29, 2008, at 11:19 AM, Shawn Van Ittersum wrote: >>>>> The correct way to handle this case is to make sure the link URLs >>>>> are composed correctly in the first place, not to add routing to >>>>> resolve bad links. Facebooker already includes URL rewriting code; >>>>> I''ve merely modified it to generate correct links for the sandbox >>>>> controller case. >>>>> >>>>> Thanks, >>>>> Shawn >>>>> >>>>> On Tue, 29 Jan 2008 10:14:22 -0600, Michael Niessner wrote: >>>>>> Or you could do: >>>>>> map.connect ''/sandboxed_controller/sandboxed_controller/:action/:id, >>>>>> :controller => ''sandboxed_controller'' >>>>>> where sandboxed_controller is the name of the controller you want >>>>>> to sandbox >>>>>> >>>>>> Michael Niessner >>>>>> >>>>>> On Jan 28, 2008, at 9:52 PM, Shawn Van Ittersum wrote: >>>>>> >>>>>>> Here''s the fix for Facebook apps that specify a controller in their >>>>>>> callback URLs. First, set this variable in your environment scripts: >>>>>>> >>>>>>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' >>>>>>> # where controller is the name of your Facebook controller >>>>>>> >>>>>>> And then patch >>>>>>> vendor/plugins/facebooker/lib/facebooker/rails/facebook_url_rewriting.rb >>>>>>> as shown in the attached diff. >>>>>>> >>>>>>> Please let me know if you encounter any issues with this patch. >>>>>>> >>>>>>> Thanks, >>>>>>> Shawn >>>>>>> <diff.out>_______________________________________________ >>>>>>> Facebooker-talk mailing list >>>>>>> Facebooker-talk at rubyforge.org >>>>>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>>>> >>>> >>> >
What about just keeping callback_url, and assume the /path/ component is a namespace? Shane On Jan 29, 2008 2:00 PM, Michael Niessner <mniessner at elevatedrails.com> wrote:> I feel mixed about the name. I like that callback_path translates to > the path component of your callback url. I like that sandbox_namespace > signals an intention to sandbox the app using a namespace, providing > guidance of how to use the setting. I prefer whichever name people > would have an easier time understanding. Maybe a few others on the > list could chime in? > > Michael Niessner > > > On Jan 29, 2008, at 1:20 PM, Shawn Van Ittersum wrote: > > > Hi Michael, > > > > I agree with you about namespaces. To be clear, my example code was > > only one possible implementation. My patch is not intended to force > > sandboxing to one controller only, but rather to any namespace > > desired by the developer. I would still like to keep the config > > variable named FACEBOOKER_CALLBACK_PATH, as it relates directly to > > the Facebook callback URL setting. So to update the example: > > > > ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/namespace'' > > # where Facebook Developer callback url = http://yourserver.com:port/ > > namespace > > > > Shawn > > > > On Tue, 29 Jan 2008 12:44:14 -0600, Michael Niessner wrote: > >> Actually, the implementation of your patch is probably correct. It''s > >> just the intent that is all wrong. If you change > >> > >> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' to > >> ENV[''FACEBOOKER_SANDBOX_NAMESPACE''] = ''/namespace'' > >> > >> You get the benefits of multiple controllers without having to add a > >> route for each one. Additionally you can take advantage of all the > >> goodness that is map.resources. > >> > >> Also a unit test would be a nice addition to your patch. > >> > >> Michael Niessner > >> > >> > >> On Jan 29, 2008, at 11:30 AM, Michael Niessner wrote: > >>> I strongly disagree. Your approach leads to the very poor design > >>> decision of placing all facebook actions in a single controller. By > >>> using routing you can use multiple controllers in a sandboxed > >>> environment. > >>> > >>> Set your callback_url on facebook to > >>> http://yourhost.com/yourapp/sandbox/ > >>> Then add the following routes > >>> map.connect ''/sandbox/controller_1/:action/:id'', :controller => > >>> ''controller_1'' > >>> map.connect ''/sandbox/controller_2/:action/:id'', :controller => > >>> ''controller_2'' > >>> > >>> I don''t think adding code to facebooker to achieve a limited subset > >>> of the functionality that can be obtained by using rails routes is > >>> the "correct way" to handle this case. > >>> > >>> Michael Niessner > >>> > >>> On Jan 29, 2008, at 11:19 AM, Shawn Van Ittersum wrote: > >>>> The correct way to handle this case is to make sure the link URLs > >>>> are composed correctly in the first place, not to add routing to > >>>> resolve bad links. Facebooker already includes URL rewriting code; > >>>> I''ve merely modified it to generate correct links for the sandbox > >>>> controller case. > >>>> > >>>> Thanks, > >>>> Shawn > >>>> > >>>> On Tue, 29 Jan 2008 10:14:22 -0600, Michael Niessner wrote: > >>>>> Or you could do: > >>>>> map.connect ''/sandboxed_controller/ > >>>>> sandboxed_controller/:action/:id, > >>>>> :controller => ''sandboxed_controller'' > >>>>> where sandboxed_controller is the name of the controller you want > >>>>> to sandbox > >>>>> > >>>>> Michael Niessner > >>>>> > >>>>> On Jan 28, 2008, at 9:52 PM, Shawn Van Ittersum wrote: > >>>>> > >>>>>> Here''s the fix for Facebook apps that specify a controller in > >>>>>> their > >>>>>> callback URLs. First, set this variable in your environment > >>>>>> scripts: > >>>>>> > >>>>>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' > >>>>>> # where controller is the name of your Facebook controller > >>>>>> > >>>>>> And then patch > >>>>>> vendor/plugins/facebooker/lib/facebooker/rails/ > >>>>>> facebook_url_rewriting.rb > >>>>>> as shown in the attached diff. > >>>>>> > >>>>>> Please let me know if you encounter any issues with this patch. > >>>>>> > >>>>>> Thanks, > >>>>>> Shawn > >>>>>> <diff.out>_______________________________________________ > >>>>>> Facebooker-talk mailing list > >>>>>> 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 >-- http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com
Shane''s idea is the winner. When facebooker.yml parses callback_url it can put the host component in where it currently does and stuff the path into ENV[''FACEBOOKER_SANDBOX_NAMESPACE'']. Then developers only need to copy their callback_url into callback_url of facebooker.yml. Michael Niessner On Jan 29, 2008, at 3:10 PM, Shane Vitarana wrote:> What about just keeping callback_url, and assume the /path/ component > is a namespace? > > Shane > > On Jan 29, 2008 2:00 PM, Michael Niessner > <mniessner at elevatedrails.com> wrote: >> I feel mixed about the name. I like that callback_path translates to >> the path component of your callback url. I like that >> sandbox_namespace >> signals an intention to sandbox the app using a namespace, providing >> guidance of how to use the setting. I prefer whichever name people >> would have an easier time understanding. Maybe a few others on the >> list could chime in? >> >> Michael Niessner >> >> >> On Jan 29, 2008, at 1:20 PM, Shawn Van Ittersum wrote: >> >>> Hi Michael, >>> >>> I agree with you about namespaces. To be clear, my example code was >>> only one possible implementation. My patch is not intended to force >>> sandboxing to one controller only, but rather to any namespace >>> desired by the developer. I would still like to keep the config >>> variable named FACEBOOKER_CALLBACK_PATH, as it relates directly to >>> the Facebook callback URL setting. So to update the example: >>> >>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/namespace'' >>> # where Facebook Developer callback url = http:// >>> yourserver.com:port/ >>> namespace >>> >>> Shawn >>> >>> On Tue, 29 Jan 2008 12:44:14 -0600, Michael Niessner wrote: >>>> Actually, the implementation of your patch is probably correct. >>>> It''s >>>> just the intent that is all wrong. If you change >>>> >>>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' to >>>> ENV[''FACEBOOKER_SANDBOX_NAMESPACE''] = ''/namespace'' >>>> >>>> You get the benefits of multiple controllers without having to >>>> add a >>>> route for each one. Additionally you can take advantage of all the >>>> goodness that is map.resources. >>>> >>>> Also a unit test would be a nice addition to your patch. >>>> >>>> Michael Niessner >>>> >>>> >>>> On Jan 29, 2008, at 11:30 AM, Michael Niessner wrote: >>>>> I strongly disagree. Your approach leads to the very poor design >>>>> decision of placing all facebook actions in a single controller. >>>>> By >>>>> using routing you can use multiple controllers in a sandboxed >>>>> environment. >>>>> >>>>> Set your callback_url on facebook to >>>>> http://yourhost.com/yourapp/sandbox/ >>>>> Then add the following routes >>>>> map.connect ''/sandbox/controller_1/:action/:id'', :controller => >>>>> ''controller_1'' >>>>> map.connect ''/sandbox/controller_2/:action/:id'', :controller => >>>>> ''controller_2'' >>>>> >>>>> I don''t think adding code to facebooker to achieve a limited >>>>> subset >>>>> of the functionality that can be obtained by using rails routes is >>>>> the "correct way" to handle this case. >>>>> >>>>> Michael Niessner >>>>> >>>>> On Jan 29, 2008, at 11:19 AM, Shawn Van Ittersum wrote: >>>>>> The correct way to handle this case is to make sure the link URLs >>>>>> are composed correctly in the first place, not to add routing to >>>>>> resolve bad links. Facebooker already includes URL rewriting >>>>>> code; >>>>>> I''ve merely modified it to generate correct links for the sandbox >>>>>> controller case. >>>>>> >>>>>> Thanks, >>>>>> Shawn >>>>>> >>>>>> On Tue, 29 Jan 2008 10:14:22 -0600, Michael Niessner wrote: >>>>>>> Or you could do: >>>>>>> map.connect ''/sandboxed_controller/ >>>>>>> sandboxed_controller/:action/:id, >>>>>>> :controller => ''sandboxed_controller'' >>>>>>> where sandboxed_controller is the name of the controller you >>>>>>> want >>>>>>> to sandbox >>>>>>> >>>>>>> Michael Niessner >>>>>>> >>>>>>> On Jan 28, 2008, at 9:52 PM, Shawn Van Ittersum wrote: >>>>>>> >>>>>>>> Here''s the fix for Facebook apps that specify a controller in >>>>>>>> their >>>>>>>> callback URLs. First, set this variable in your environment >>>>>>>> scripts: >>>>>>>> >>>>>>>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' >>>>>>>> # where controller is the name of your Facebook controller >>>>>>>> >>>>>>>> And then patch >>>>>>>> vendor/plugins/facebooker/lib/facebooker/rails/ >>>>>>>> facebook_url_rewriting.rb >>>>>>>> as shown in the attached diff. >>>>>>>> >>>>>>>> Please let me know if you encounter any issues with this patch. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Shawn >>>>>>>> <diff.out>_______________________________________________ >>>>>>>> Facebooker-talk mailing list >>>>>>>> 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 >> > > > > -- > http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com
Works for me. Thanks, guys! Shawn On Tue, 29 Jan 2008 15:32:10 -0600, Michael Niessner wrote:> Shane''s idea is the winner. When facebooker.yml parses callback_url > it can put the host component in where it currently does and stuff > the path into ENV[''FACEBOOKER_SANDBOX_NAMESPACE'']. Then developers > only need to copy their callback_url into callback_url of > facebooker.yml. > > Michael Niessner > > On Jan 29, 2008, at 3:10 PM, Shane Vitarana wrote: > >> What about just keeping callback_url, and assume the /path/ component >> is a namespace? >> >> Shane >> >> On Jan 29, 2008 2:00 PM, Michael Niessner >> <mniessner at elevatedrails.com> wrote: >>> I feel mixed about the name. I like that callback_path translates to >>> the path component of your callback url. I like that sandbox_namespace >>> signals an intention to sandbox the app using a namespace, providing >>> guidance of how to use the setting. I prefer whichever name people >>> would have an easier time understanding. Maybe a few others on the >>> list could chime in? >>> >>> Michael Niessner >>> >>> >>> On Jan 29, 2008, at 1:20 PM, Shawn Van Ittersum wrote: >>> >>>> Hi Michael, >>>> >>>> I agree with you about namespaces. To be clear, my example code was >>>> only one possible implementation. My patch is not intended to force >>>> sandboxing to one controller only, but rather to any namespace >>>> desired by the developer. I would still like to keep the config >>>> variable named FACEBOOKER_CALLBACK_PATH, as it relates directly to >>>> the Facebook callback URL setting. So to update the example: >>>> >>>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/namespace'' >>>> # where Facebook Developer callback url = http://yourserver.com:port/ >>>> namespace >>>> >>>> Shawn >>>> >>>> On Tue, 29 Jan 2008 12:44:14 -0600, Michael Niessner wrote: >>>>> Actually, the implementation of your patch is probably correct. It''s >>>>> just the intent that is all wrong. If you change >>>>> >>>>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' to >>>>> ENV[''FACEBOOKER_SANDBOX_NAMESPACE''] = ''/namespace'' >>>>> >>>>> You get the benefits of multiple controllers without having to add a >>>>> route for each one. Additionally you can take advantage of all the >>>>> goodness that is map.resources. >>>>> >>>>> Also a unit test would be a nice addition to your patch. >>>>> >>>>> Michael Niessner >>>>> >>>>> >>>>> On Jan 29, 2008, at 11:30 AM, Michael Niessner wrote: >>>>>> I strongly disagree. Your approach leads to the very poor design >>>>>> decision of placing all facebook actions in a single controller. By >>>>>> using routing you can use multiple controllers in a sandboxed >>>>>> environment. >>>>>> >>>>>> Set your callback_url on facebook to >>>>>> http://yourhost.com/yourapp/sandbox/ >>>>>> Then add the following routes >>>>>> map.connect ''/sandbox/controller_1/:action/:id'', :controller => >>>>>> ''controller_1'' >>>>>> map.connect ''/sandbox/controller_2/:action/:id'', :controller => >>>>>> ''controller_2'' >>>>>> >>>>>> I don''t think adding code to facebooker to achieve a limited subset >>>>>> of the functionality that can be obtained by using rails routes is >>>>>> the "correct way" to handle this case. >>>>>> >>>>>> Michael Niessner >>>>>> >>>>>> On Jan 29, 2008, at 11:19 AM, Shawn Van Ittersum wrote: >>>>>>> The correct way to handle this case is to make sure the link URLs >>>>>>> are composed correctly in the first place, not to add routing to >>>>>>> resolve bad links. Facebooker already includes URL rewriting code; >>>>>>> I''ve merely modified it to generate correct links for the sandbox >>>>>>> controller case. >>>>>>> >>>>>>> Thanks, >>>>>>> Shawn >>>>>>> >>>>>>> On Tue, 29 Jan 2008 10:14:22 -0600, Michael Niessner wrote: >>>>>>>> Or you could do: >>>>>>>> map.connect ''/sandboxed_controller/ >>>>>>>> sandboxed_controller/:action/:id, >>>>>>>> :controller => ''sandboxed_controller'' >>>>>>>> where sandboxed_controller is the name of the controller you want >>>>>>>> to sandbox >>>>>>>> >>>>>>>> Michael Niessner >>>>>>>> >>>>>>>> On Jan 28, 2008, at 9:52 PM, Shawn Van Ittersum wrote: >>>>>>>> >>>>>>>>> Here''s the fix for Facebook apps that specify a controller in >>>>>>>>> their >>>>>>>>> callback URLs. First, set this variable in your environment >>>>>>>>> scripts: >>>>>>>>> >>>>>>>>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' >>>>>>>>> # where controller is the name of your Facebook controller >>>>>>>>> >>>>>>>>> And then patch >>>>>>>>> vendor/plugins/facebooker/lib/facebooker/rails/ >>>>>>>>> facebook_url_rewriting.rb >>>>>>>>> as shown in the attached diff. >>>>>>>>> >>>>>>>>> Please let me know if you encounter any issues with this patch. >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> Shawn >>>>>>>>> <diff.out>_______________________________________________ >>>>>>>>> Facebooker-talk mailing list >>>>>>>>> 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 >>> >> >> >> >> -- >> http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com >
Hey guys, I have tested Shawn''s patch on my application and it works great, please let me know when its checked in so I can update the example on my blog to use that approach as its much cleaner than the way I was doing things. One thing you may want to add to the documentation to be clear is that in order to work you must set your facebook callback url in facebook to include the namespace with a trailing slash, a precise example: Namespace sandbox: facebook callback url - http://yoururl:yourport/namespace/ ENV[''FACEBOOKER_SANDBOX_NAMESPACE''] = ''/namespace'' thanks Joel On Jan 29, 2008, at 5:01 PM, Shawn Van Ittersum wrote:> Works for me. Thanks, guys! > > Shawn > > On Tue, 29 Jan 2008 15:32:10 -0600, Michael Niessner wrote: >> Shane''s idea is the winner. When facebooker.yml parses callback_url >> it can put the host component in where it currently does and stuff >> the path into ENV[''FACEBOOKER_SANDBOX_NAMESPACE'']. Then developers >> only need to copy their callback_url into callback_url of >> facebooker.yml. >> >> Michael Niessner >> >> On Jan 29, 2008, at 3:10 PM, Shane Vitarana wrote: >> >>> What about just keeping callback_url, and assume the /path/ >>> component >>> is a namespace? >>> >>> Shane >>> >>> On Jan 29, 2008 2:00 PM, Michael Niessner >>> <mniessner at elevatedrails.com> wrote: >>>> I feel mixed about the name. I like that callback_path translates >>>> to >>>> the path component of your callback url. I like that >>>> sandbox_namespace >>>> signals an intention to sandbox the app using a namespace, >>>> providing >>>> guidance of how to use the setting. I prefer whichever name people >>>> would have an easier time understanding. Maybe a few others on the >>>> list could chime in? >>>> >>>> Michael Niessner >>>> >>>> >>>> On Jan 29, 2008, at 1:20 PM, Shawn Van Ittersum wrote: >>>> >>>>> Hi Michael, >>>>> >>>>> I agree with you about namespaces. To be clear, my example code >>>>> was >>>>> only one possible implementation. My patch is not intended to >>>>> force >>>>> sandboxing to one controller only, but rather to any namespace >>>>> desired by the developer. I would still like to keep the config >>>>> variable named FACEBOOKER_CALLBACK_PATH, as it relates directly to >>>>> the Facebook callback URL setting. So to update the example: >>>>> >>>>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/namespace'' >>>>> # where Facebook Developer callback url = http:// >>>>> yourserver.com:port/ >>>>> namespace >>>>> >>>>> Shawn >>>>> >>>>> On Tue, 29 Jan 2008 12:44:14 -0600, Michael Niessner wrote: >>>>>> Actually, the implementation of your patch is probably correct. >>>>>> It''s >>>>>> just the intent that is all wrong. If you change >>>>>> >>>>>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' to >>>>>> ENV[''FACEBOOKER_SANDBOX_NAMESPACE''] = ''/namespace'' >>>>>> >>>>>> You get the benefits of multiple controllers without having to >>>>>> add a >>>>>> route for each one. Additionally you can take advantage of all >>>>>> the >>>>>> goodness that is map.resources. >>>>>> >>>>>> Also a unit test would be a nice addition to your patch. >>>>>> >>>>>> Michael Niessner >>>>>> >>>>>> >>>>>> On Jan 29, 2008, at 11:30 AM, Michael Niessner wrote: >>>>>>> I strongly disagree. Your approach leads to the very poor design >>>>>>> decision of placing all facebook actions in a single >>>>>>> controller. By >>>>>>> using routing you can use multiple controllers in a sandboxed >>>>>>> environment. >>>>>>> >>>>>>> Set your callback_url on facebook to >>>>>>> http://yourhost.com/yourapp/sandbox/ >>>>>>> Then add the following routes >>>>>>> map.connect ''/sandbox/controller_1/:action/:id'', :controller => >>>>>>> ''controller_1'' >>>>>>> map.connect ''/sandbox/controller_2/:action/:id'', :controller => >>>>>>> ''controller_2'' >>>>>>> >>>>>>> I don''t think adding code to facebooker to achieve a limited >>>>>>> subset >>>>>>> of the functionality that can be obtained by using rails >>>>>>> routes is >>>>>>> the "correct way" to handle this case. >>>>>>> >>>>>>> Michael Niessner >>>>>>> >>>>>>> On Jan 29, 2008, at 11:19 AM, Shawn Van Ittersum wrote: >>>>>>>> The correct way to handle this case is to make sure the link >>>>>>>> URLs >>>>>>>> are composed correctly in the first place, not to add routing >>>>>>>> to >>>>>>>> resolve bad links. Facebooker already includes URL rewriting >>>>>>>> code; >>>>>>>> I''ve merely modified it to generate correct links for the >>>>>>>> sandbox >>>>>>>> controller case. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Shawn >>>>>>>> >>>>>>>> On Tue, 29 Jan 2008 10:14:22 -0600, Michael Niessner wrote: >>>>>>>>> Or you could do: >>>>>>>>> map.connect ''/sandboxed_controller/ >>>>>>>>> sandboxed_controller/:action/:id, >>>>>>>>> :controller => ''sandboxed_controller'' >>>>>>>>> where sandboxed_controller is the name of the controller you >>>>>>>>> want >>>>>>>>> to sandbox >>>>>>>>> >>>>>>>>> Michael Niessner >>>>>>>>> >>>>>>>>> On Jan 28, 2008, at 9:52 PM, Shawn Van Ittersum wrote: >>>>>>>>> >>>>>>>>>> Here''s the fix for Facebook apps that specify a controller in >>>>>>>>>> their >>>>>>>>>> callback URLs. First, set this variable in your environment >>>>>>>>>> scripts: >>>>>>>>>> >>>>>>>>>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' >>>>>>>>>> # where controller is the name of your Facebook controller >>>>>>>>>> >>>>>>>>>> And then patch >>>>>>>>>> vendor/plugins/facebooker/lib/facebooker/rails/ >>>>>>>>>> facebook_url_rewriting.rb >>>>>>>>>> as shown in the attached diff. >>>>>>>>>> >>>>>>>>>> Please let me know if you encounter any issues with this >>>>>>>>>> patch. >>>>>>>>>> >>>>>>>>>> Thanks, >>>>>>>>>> Shawn >>>>>>>>>> <diff.out>_______________________________________________ >>>>>>>>>> Facebooker-talk mailing list >>>>>>>>>> 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 >>>> >>> >>> >>> >>> -- >>> http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com >> > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk
My code has the old ENV FACEBOOKER_CALLBACK_PATH. I''ll update the code in an hour. Shawn On Feb 1, 2008, at 7:40 AM, Joel Nylund <jnylund at yahoo.com> wrote:> Hey guys, > > I have tested Shawn''s patch on my application and it works great, > please let me know when its checked in so I can update the example > on my blog to use that approach > as its much cleaner than the way I was doing things. > > One thing you may want to add to the documentation to be clear is > that in order to work you must set your facebook callback url in > facebook > > to include the namespace with a trailing slash, a precise example: > > Namespace sandbox: > > facebook callback url - http://yoururl:yourport/namespace/ > ENV[''FACEBOOKER_SANDBOX_NAMESPACE''] = ''/namespace'' > > thanks > Joel > > On Jan 29, 2008, at 5:01 PM, Shawn Van Ittersum wrote: > >> Works for me. Thanks, guys! >> >> Shawn >> >> On Tue, 29 Jan 2008 15:32:10 -0600, Michael Niessner wrote: >>> Shane''s idea is the winner. When facebooker.yml parses callback_url >>> it can put the host component in where it currently does and stuff >>> the path into ENV[''FACEBOOKER_SANDBOX_NAMESPACE'']. Then developers >>> only need to copy their callback_url into callback_url of >>> facebooker.yml. >>> >>> Michael Niessner >>> >>> On Jan 29, 2008, at 3:10 PM, Shane Vitarana wrote: >>> >>>> What about just keeping callback_url, and assume the /path/ >>>> component >>>> is a namespace? >>>> >>>> Shane >>>> >>>> On Jan 29, 2008 2:00 PM, Michael Niessner >>>> <mniessner at elevatedrails.com> wrote: >>>>> I feel mixed about the name. I like that callback_path >>>>> translates to >>>>> the path component of your callback url. I like that >>>>> sandbox_namespace >>>>> signals an intention to sandbox the app using a namespace, >>>>> providing >>>>> guidance of how to use the setting. I prefer whichever name people >>>>> would have an easier time understanding. Maybe a few others on the >>>>> list could chime in? >>>>> >>>>> Michael Niessner >>>>> >>>>> >>>>> On Jan 29, 2008, at 1:20 PM, Shawn Van Ittersum wrote: >>>>> >>>>>> Hi Michael, >>>>>> >>>>>> I agree with you about namespaces. To be clear, my example >>>>>> code was >>>>>> only one possible implementation. My patch is not intended to >>>>>> force >>>>>> sandboxing to one controller only, but rather to any namespace >>>>>> desired by the developer. I would still like to keep the config >>>>>> variable named FACEBOOKER_CALLBACK_PATH, as it relates directly >>>>>> to >>>>>> the Facebook callback URL setting. So to update the example: >>>>>> >>>>>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/namespace'' >>>>>> # where Facebook Developer callback url = http:// >>>>>> yourserver.com:port/ >>>>>> namespace >>>>>> >>>>>> Shawn >>>>>> >>>>>> On Tue, 29 Jan 2008 12:44:14 -0600, Michael Niessner wrote: >>>>>>> Actually, the implementation of your patch is probably >>>>>>> correct. It''s >>>>>>> just the intent that is all wrong. If you change >>>>>>> >>>>>>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' to >>>>>>> ENV[''FACEBOOKER_SANDBOX_NAMESPACE''] = ''/namespace'' >>>>>>> >>>>>>> You get the benefits of multiple controllers without having to >>>>>>> add a >>>>>>> route for each one. Additionally you can take advantage of all >>>>>>> the >>>>>>> goodness that is map.resources. >>>>>>> >>>>>>> Also a unit test would be a nice addition to your patch. >>>>>>> >>>>>>> Michael Niessner >>>>>>> >>>>>>> >>>>>>> On Jan 29, 2008, at 11:30 AM, Michael Niessner wrote: >>>>>>>> I strongly disagree. Your approach leads to the very poor >>>>>>>> design >>>>>>>> decision of placing all facebook actions in a single >>>>>>>> controller. By >>>>>>>> using routing you can use multiple controllers in a sandboxed >>>>>>>> environment. >>>>>>>> >>>>>>>> Set your callback_url on facebook to >>>>>>>> http://yourhost.com/yourapp/sandbox/ >>>>>>>> Then add the following routes >>>>>>>> map.connect ''/sandbox/controller_1/:action/:id'', :controller => >>>>>>>> ''controller_1'' >>>>>>>> map.connect ''/sandbox/controller_2/:action/:id'', :controller => >>>>>>>> ''controller_2'' >>>>>>>> >>>>>>>> I don''t think adding code to facebooker to achieve a limited >>>>>>>> subset >>>>>>>> of the functionality that can be obtained by using rails >>>>>>>> routes is >>>>>>>> the "correct way" to handle this case. >>>>>>>> >>>>>>>> Michael Niessner >>>>>>>> >>>>>>>> On Jan 29, 2008, at 11:19 AM, Shawn Van Ittersum wrote: >>>>>>>>> The correct way to handle this case is to make sure the link >>>>>>>>> URLs >>>>>>>>> are composed correctly in the first place, not to add >>>>>>>>> routing to >>>>>>>>> resolve bad links. Facebooker already includes URL >>>>>>>>> rewriting code; >>>>>>>>> I''ve merely modified it to generate correct links for the >>>>>>>>> sandbox >>>>>>>>> controller case. >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> Shawn >>>>>>>>> >>>>>>>>> On Tue, 29 Jan 2008 10:14:22 -0600, Michael Niessner wrote: >>>>>>>>>> Or you could do: >>>>>>>>>> map.connect ''/sandboxed_controller/ >>>>>>>>>> sandboxed_controller/:action/:id, >>>>>>>>>> :controller => ''sandboxed_controller'' >>>>>>>>>> where sandboxed_controller is the name of the controller >>>>>>>>>> you want >>>>>>>>>> to sandbox >>>>>>>>>> >>>>>>>>>> Michael Niessner >>>>>>>>>> >>>>>>>>>> On Jan 28, 2008, at 9:52 PM, Shawn Van Ittersum wrote: >>>>>>>>>> >>>>>>>>>>> Here''s the fix for Facebook apps that specify a controller >>>>>>>>>>> in >>>>>>>>>>> their >>>>>>>>>>> callback URLs. First, set this variable in your environment >>>>>>>>>>> scripts: >>>>>>>>>>> >>>>>>>>>>> ENV[''FACEBOOKER_CALLBACK_PATH''] = ''/controller'' >>>>>>>>>>> # where controller is the name of your Facebook controller >>>>>>>>>>> >>>>>>>>>>> And then patch >>>>>>>>>>> vendor/plugins/facebooker/lib/facebooker/rails/ >>>>>>>>>>> facebook_url_rewriting.rb >>>>>>>>>>> as shown in the attached diff. >>>>>>>>>>> >>>>>>>>>>> Please let me know if you encounter any issues with this >>>>>>>>>>> patch. >>>>>>>>>>> >>>>>>>>>>> Thanks, >>>>>>>>>>> Shawn >>>>>>>>>>> <diff.out>_______________________________________________ >>>>>>>>>>> Facebooker-talk mailing list >>>>>>>>>>> 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 >>>>> >>>> >>>> >>>> >>>> -- >>>> http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com >>> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >
Hi all! Just curious if that namespace support had been added as discussed in a previous thread using this name. I''ve currently got my facebook app''s controllers inside a subfolder named "facebook" and my callback url looks something like "http://app-domain.com/facebook/". Routes are set up appropriately to direct facebook/:action url''s to the appropriate controller. Unfortunately, my callback url is being prepended to my javascript/stylesheet includes in the main (non- facebook) part of the app giving me something like this for each stylesheet/javascript include: ActionController::RoutingError (No route matches "/facebook// stylesheets/groups.css" with {:canvas=>false, :method=>:get}) It''s entirely possible that I''ve just horribly misconfigured something. If so, hopefully someone out there has some ideas. :-) Thanks! -Joel
Joel- I''ve been meaning to do it using Shawn''s patch but didn''t get around to it yet. It''s on my todo list, but if anyone else has a need for it and does it, it''ll be much appreciated. Shane On Wed, Feb 27, 2008 at 6:37 PM, Joel Watson <joel at i5labs.com> wrote:> Hi all! > > Just curious if that namespace support had been added as discussed in > a previous thread using this name. I''ve currently got my facebook > app''s controllers inside a subfolder named "facebook" and my callback > url looks something like "http://app-domain.com/facebook/". Routes are > set up appropriately to direct facebook/:action url''s to the > appropriate controller. Unfortunately, my callback url is being > prepended to my javascript/stylesheet includes in the main (non- > facebook) part of the app giving me something like this for each > stylesheet/javascript include: > > ActionController::RoutingError (No route matches "/facebook// > stylesheets/groups.css" with {:canvas=>false, :method=>:get}) > > It''s entirely possible that I''ve just horribly misconfigured > something. If so, hopefully someone out there has some ideas. :-) > > Thanks! > > -Joel > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk >-- http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com
Ive been using Shawns patch for a while and it works great, what can I do to help Shane? Just change the var name and submit to sourceforge? thanks Joel Nylund (the other Joel) On Feb 27, 2008, at 7:50 PM, Shane Vitarana wrote:> Joel- > > I''ve been meaning to do it using Shawn''s patch but didn''t get around > to it yet. It''s on my todo list, but if anyone else has a need for it > and does it, it''ll be much appreciated. > > Shane > > On Wed, Feb 27, 2008 at 6:37 PM, Joel Watson <joel at i5labs.com> wrote: >> Hi all! >> >> Just curious if that namespace support had been added as discussed in >> a previous thread using this name. I''ve currently got my facebook >> app''s controllers inside a subfolder named "facebook" and my callback >> url looks something like "http://app-domain.com/facebook/". Routes >> are >> set up appropriately to direct facebook/:action url''s to the >> appropriate controller. Unfortunately, my callback url is being >> prepended to my javascript/stylesheet includes in the main (non- >> facebook) part of the app giving me something like this for each >> stylesheet/javascript include: >> >> ActionController::RoutingError (No route matches "/facebook// >> stylesheets/groups.css" with {:canvas=>false, :method=>:get}) >> >> It''s entirely possible that I''ve just horribly misconfigured >> something. If so, hopefully someone out there has some ideas. :-) >> >> Thanks! >> >> -Joel >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> > > > > -- > http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk
Hey the other Joel :) Yup, the var name change, and tests have to be added that covers the change. Then submit it to Rubyforge. On Wed, Feb 27, 2008 at 8:15 PM, Joel Nylund <jnylund at yahoo.com> wrote:> Ive been using Shawns patch for a while and it works great, what can I > do to help Shane? Just change the var name and submit to sourceforge? > > thanks > Joel Nylund (the other Joel) > > > > On Feb 27, 2008, at 7:50 PM, Shane Vitarana wrote: > > > > > Joel- > > > > I''ve been meaning to do it using Shawn''s patch but didn''t get around > > to it yet. It''s on my todo list, but if anyone else has a need for it > > and does it, it''ll be much appreciated. > > > > Shane > > > > On Wed, Feb 27, 2008 at 6:37 PM, Joel Watson <joel at i5labs.com> wrote: > >> Hi all! > >> > >> Just curious if that namespace support had been added as discussed in > >> a previous thread using this name. I''ve currently got my facebook > >> app''s controllers inside a subfolder named "facebook" and my callback > >> url looks something like "http://app-domain.com/facebook/". Routes > >> are > >> set up appropriately to direct facebook/:action url''s to the > >> appropriate controller. Unfortunately, my callback url is being > >> prepended to my javascript/stylesheet includes in the main (non- > >> facebook) part of the app giving me something like this for each > >> stylesheet/javascript include: > >> > >> ActionController::RoutingError (No route matches "/facebook// > >> stylesheets/groups.css" with {:canvas=>false, :method=>:get}) > >> > >> It''s entirely possible that I''ve just horribly misconfigured > >> something. If so, hopefully someone out there has some ideas. :-) > >> > >> Thanks! > >> > >> -Joel > >> _______________________________________________ > >> Facebooker-talk mailing list > >> Facebooker-talk at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/facebooker-talk > >> > > > > > > > > -- > > http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > >-- http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com
Hey, guys, I have been struggling to figure out a reasonable way to test this. Can someone help me with the strategy? I dont see any test cases for rewrite_url_with_facebooker today, so I don''t have any guidelines to go on. What I think I need to test is a working version of url_for that allows me to set all the basics up. The integration tests seem to have url_for stubbed out. What we basically want to test is: If the user is in a canvas and if they have FACEBOOKER_SANDBOX_NAMESPACE defined, that we strip off the namespace in the urls that are generated. So in my application for example I have: FACEBOOKER_SANDBOX_NAMESPACE: /face FACEBOOKER_RELATIVE_URL_ROOT: gottakeepup path is: /gottakeepup/face/destroy_task?task_id=3935 after rewrite path is: /gottakeepup/destroy_task?task_id=3935 Works like a charm in a real application, but how can I produce this scenario in the test framework? thanks Joel On Feb 27, 2008, at 10:40 PM, Shane Vitarana wrote:> Hey the other Joel :) Yup, the var name change, and tests have to be > added that covers the change. Then submit it to Rubyforge. > > On Wed, Feb 27, 2008 at 8:15 PM, Joel Nylund <jnylund at yahoo.com> > wrote: >> Ive been using Shawns patch for a while and it works great, what >> can I >> do to help Shane? Just change the var name and submit to sourceforge? >> >> thanks >> Joel Nylund (the other Joel) >> >> >> >> On Feb 27, 2008, at 7:50 PM, Shane Vitarana wrote: >> >> >> >>> Joel- >>> >>> I''ve been meaning to do it using Shawn''s patch but didn''t get around >>> to it yet. It''s on my todo list, but if anyone else has a need >>> for it >>> and does it, it''ll be much appreciated. >>> >>> Shane >>> >>> On Wed, Feb 27, 2008 at 6:37 PM, Joel Watson <joel at i5labs.com> >>> wrote: >>>> Hi all! >>>> >>>> Just curious if that namespace support had been added as >>>> discussed in >>>> a previous thread using this name. I''ve currently got my facebook >>>> app''s controllers inside a subfolder named "facebook" and my >>>> callback >>>> url looks something like "http://app-domain.com/facebook/". Routes >>>> are >>>> set up appropriately to direct facebook/:action url''s to the >>>> appropriate controller. Unfortunately, my callback url is being >>>> prepended to my javascript/stylesheet includes in the main (non- >>>> facebook) part of the app giving me something like this for each >>>> stylesheet/javascript include: >>>> >>>> ActionController::RoutingError (No route matches "/facebook// >>>> stylesheets/groups.css" with {:canvas=>false, :method=>:get}) >>>> >>>> It''s entirely possible that I''ve just horribly misconfigured >>>> something. If so, hopefully someone out there has some ideas. :-) >>>> >>>> Thanks! >>>> >>>> -Joel >>>> _______________________________________________ >>>> Facebooker-talk mailing list >>>> Facebooker-talk at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>> >>> >>> >>> >>> -- >>> http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com >>> _______________________________________________ >>> Facebooker-talk mailing list >>> Facebooker-talk at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> >> > > > > -- > http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com