Skip to content

Instantly share code, notes, and snippets.

@bryfox
Forked from mjfreshyfresh/fb-comments.rb
Created January 7, 2010 00:58
Show Gist options
  • Save bryfox/270860 to your computer and use it in GitHub Desktop.
Save bryfox/270860 to your computer and use it in GitHub Desktop.
Facebook comment callback (_method fix)
# app_helper
def callback_attribute
%{ callbackurl="#{url_for(request.path) + "?_method=GET&" + request.query_string}" }
end
# in the view
<fb:comments xid="m_story_<%= @first.id %>_comments" canpost="true" candelete="false" showform="true" numposts="5" publish_feed="false" simple="true" reverse="true" returnurl="<%= link_to_app "item/#{@first.id}" %>" <%= callback_attribute %>>
<fb:title> <%= @first.couple_name %></fb:title>
</fb:comments>
@bryfox
Copy link
Author

bryfox commented May 27, 2010

This assumes the newer flavor of url_for that supports optional leading slashes (sails 1.0, I believe).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment