Facebook share and like are grabbing the title from the home page - ruby-on-rails

Share and like are working perfectly on my other PHP site, but on my new Rails site, it is just posting the home page url and the title from the home page. It's also not grabbing any images when posting through FB share.
I tried everything - setting the og:title meta property, changing the href in the url param for share.php to facebook, etc.
What am I missing? Has anyone encountered this problem on RoR?
Thanks,
Bella

I think I know why. The page can't be views without a login. FB can't therefore see the page and is redirected to the log in page.

Related

Navigate to original requested page

I have page where are secured by session. In case session does exists, then navigate to login page. This works fine.
Now, Let's say I am at some page like abc.aspx. Session does not exists. System navigates to th login page. So, once login, can i navigate the user to the page which was originally requested ?
Usually it is performed by adding the requested URL as a query parameter to Login page URL http://fakehost/Login?retUrl=originalpage
so app code can redirect it back. Forms authentication mechanism does it for you.
yes you can however it would be recommended to add a ReturnUrl querystring which contains the page they came from or need to go to after they logged in. you can also use Request.UrlReferrer I believe which gives you the page they came from but means if for example they came from google to your site to login and you redirect, it would go back to google.

How to tag a Facebook page using UIActivityViewController

I am using UIActivityViewController to post to Facebook in iOS 6 and have that working fine. However, when I try to tag a Facebook page by including #pagename in the message, the raw text '#pagename' is posted and is not linked to the page. I am able to do this directly on Facebooks website so I know that the page name is correct. Is this possible to do?
After a lot of searching, I have determined that this is not possible with the current UIActivityViewController API. Even if it did work, you need to 'like' a page before you can tag it, so this will not work for my situation.

Facebook Likes on pages within a page tab app

I'm building a page tab app on Facebook that allows users to create and display their own entries, and I want to be able to have a share and a like button specific to each entry.
I'm using the app_data parameter to pass the path to the page within the app, and it works perfectly with the share button - a user can share their entry to their wall, and that share links back to the appropriate page.
However, when I try to do the same thing with Likes, it instead shows the total likes for the page the page tab is a child of. Has anyone had a similar problem or could point me in the right direction to sorting it out?
Cheers!
You can’t like specific page tab contents – Facebook will count all likes for the Facebook page, no matter what app ID and possibly app_data the URL contains.
You could however like your own URLs that are loaded inside the page tab frame – and have them redirect to themselves embedded into the iframe with JavaScript if a real user is visiting them.

Facebook Application and URLs

I developed a Facebook application using Ruby on Rails but I have a slightly annoying problem.
When I click any URL inside the application the application redirects to the correct view and everything is working just fine but the URL on the browser is not updating accordingly. The problem is that if I click refresh on the page I will be redirected to the home page of the directory ( that's correct because the URL in the browser is the home URL ) instead of the page that I was.
Example:
App URL:
https://apps.facebook.com/example
Clicking the books link is showing the page correctly but not modifying the browser's URL to:
https://apps.facebook.com/example/books
So next time that I will hit refresh I will be redirected to the home page because the browser link is still:
https://apps.facebook.com/example
Any suggestions?
you need to be aware that your app is an iframe app(i assume you didnt use FBML), that means it is contained in a iframe. So when you create your links, add a target=_top will change the url.
When You create a link You must define target with _parent like:
link

When linking to a twitter/fb/other page, why do this: "dribbble.com/username/click?type=twitter" instead of a normal link?

I was just viewing a users profile on dribbble.com, they had linked their profile with twitter, when hovering over the link to go to their twitter page, it shows a url like this:
http://dribbble.com/thyraz/click?type=twitter
I'm wondering what the website/coding reason/advantage for doing this would be? why not just put a normal link to their twitter profile? does this protect the website from phishing attempts or something?
dribbble could be tracking/counting the links?
eg, "click" could be a page which counts the click, then it sends them on their way to the page.
EDIT:
For example, search Google for "Stack Overflow" and hover over one of the sponsored links on the right. in the status bar, you will see the link goes to a page hosted by Google rather than to the actual link. This page will be keeping a record of all the clicks on that link, then redirecting the link as expected.

Resources