Created
October 26, 2009 19:13
-
-
Save mjfreshyfresh/218937 to your computer and use it in GitHub Desktop.
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
# before filter | |
before do | |
p = request.env['PATH_INFO'] | |
@request_url = p[1..p.length] unless p.nil? | |
end | |
# app_helper | |
def callback_attribute | |
if defined?(@request_url) && !@request_url.nil? | |
"callbackurl='#{link_to_app(@request_url)}?_method=GET'" | |
end | |
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 version supports query strings and doesn't require a before filter: http://gist.github.com/270860