-
-
Save bryfox/270860 to your computer and use it in GitHub Desktop.
Facebook comment callback (_method fix)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This assumes the newer flavor of url_for that supports optional leading slashes (sails 1.0, I believe).