[Facebooker-talk] redirect with application add
David Clements
digidigo at gmail.com
Tue Aug 19 16:54:24 EDT 2008
Oh I think I misunderstood the issue... You want to redirect the user back
to the original requested URL after they add the app, right?
This is what I do:
# Override this so that we get redirected to the right place.
def application_is_not_installed_by_facebook_user
redirect_to new_facebook_session.install_url(:next => next_path() )
end
def next_path
path = "#{params[:controller]}/#{params[:action]}?"
path = "/#{path}" unless Facebooker::FacebookAdapter.new_api? ||
Facebooker.is_for?(:bebo)
non_keys = ["controller", "method", "action","format", "_method",
"auth_token"]
parts = []
params.each do |k,v|
next if non_keys.include?(k.to_s) || k.to_s.starts_with("fb")
parts << "#{k}=#{v}"
end
path + parts.join("&")
end
On Tue, Aug 19, 2008 at 2:45 PM, David Clements
<david.g.clements at gmail.com>wrote:
> The call to ensure application is added acts just like a before filter. So
> you can exclude certain actions if they do not require adding the app.
>
> Dave
>
> Sent from my iPhone
>
> Dave
>
>
> On Aug 19, 2008, at 2:27 PM, "Ken Schroeder" <schroeder.ken at gmail.com>
> wrote:
>
> There are groups within our app that people can be invited too. If a user
>> recieves an invite to a group and hasn't yet added the application the
>> filter chain ends up redirecting them to the main canvas page instead of the
>> the group page directly. Is there a way to handle this if the user hasn't
>> installed the app, I tried redirect_back_or_default in one of my controllers
>> but it ended up putting me into a loop.
>> _______________________________________________
>> Facebooker-talk mailing list
>> Facebooker-talk at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/facebooker-talk
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080819/eb2b71c0/attachment.html>
More information about the Facebooker-talk
mailing list