Once you've unpacked it, edit the file vendor/gems/facebooker-1.0.xx/lib/facebooker/rails/facebook_url_rewriting.rb. Modify the relative_url_root method to the following:
class Base class << self alias :old_relative_url_root :relative_url_root def relative_url_root #Facebooker.path_prefix '/subdirectory_name' end end end
Where subdirectory_name is the name of the subdirectory that you want to run this app from. This is a bit of a hack, hard coding the directory that you want to run from, but it works. After you do this, you'll then have to configure your web server to run your app in a subdirectory. For Nginx with Passenger, simply add "passenger_base_url /subdirectory_name" to your nginx.conf in the server { } block. Now you can change your Canvas URL to http://www.yourdomainname.com/subdirectory_name.
2 comments:
Hi, thanks for your post. I finally got my fb connect site up and running on a subdirectory.
However, I would like to mention that you don't have to unpack your gems. Simply just create a ruby file in your app/config/initializers/facebooker_hack.rb
and in that file just put this
Facebooker.module_eval do
def self.path_prefix
'/subdirectory_name'
end
end
Hello,
I am not technical at all, but I am facing the same problem of trying to get a Facebook app to run in a subdirectory.
The domain for my website is: ghanaoracle.com.
I have created separate testing and production sites. So, www.ghanaoracle.com/test is the testing site and the production site is www.ghanaoracle.com.
I am testing out Facebook Connect with JomSocial on my Joomla test site and would like to use my Facebook login to login to www.ghanaoracle.com/test.
I have set up a Facebook app as follows:
App Domain: ghanaoracle.com
Site URL: http://www.ghanaoracle.com/test
When I login with Facebook Connect from the test site, it takes me back to www.ghanaoracle.com and not www.ghanaoracle.com/test/
So my question is, how do I set up the Facebook app for GhanaOracle so that it returns to my test site when I login from the test site?
I look forward to hearing back from you.
Many thanks,
Joyce
Post a Comment