<div dir="ltr">Cool. <br><br>1) new_api? is newish I think.<br><br>2) I think we have a custom starts_with , some legacy thing. <br><br>3) The next path is definitely kludgey. I'd love to see what you have.<br><br>
Also, one note. If you notice the code that adds the "/" to the path. I am not sure if that is currently necessary but there was a difference between the new facebook implementation and the old implementation of the next parameter.<br>
<br>Dave<br><br><br><div class="gmail_quote">On Wed, Aug 20, 2008 at 11:27 AM, Ken Schroeder <span dir="ltr"><<a href="mailto:schroeder.ken@gmail.com">schroeder.ken@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">Tthis worked great with a few changes for me.<br><br>Had problems with Facebooker::FacebookAdapter.new_api? Is that in a newer facebooker release?<br><br>Also not sure if you know you have a typo with starts_with("fb") should be starts_with?("fb") <br>
<br>Additionally I modified how you handled the path creation to not use the action since restful paths don't contain show or index in the url which for my use would be the generally used method I need to reference this. Probably have to case out the action if I expect something to go to edit.<br>
<br>Thanks again --ken s.<br><br><br><br><div class="gmail_quote"><div class="Ih2E3d">On Tue, Aug 19, 2008 at 4:54 PM, David Clements <span dir="ltr"><<a href="mailto:digidigo@gmail.com" target="_blank">digidigo@gmail.com</a>></span> wrote:<br>
</div><div><div></div><div class="Wj3C7c"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">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?<br><br>This is what I do:<br><br> # Override this so that we get redirected to the right place. <br>
def application_is_not_installed_by_facebook_user<br> redirect_to new_facebook_session.install_url(:next => next_path() )<br> end<br> <br> def next_path<br> path = "#{params[:controller]}/#{params[:action]}?"<br>
path = "/#{path}" unless Facebooker::FacebookAdapter.new_api? || Facebooker.is_for?(:bebo)<br> <br> non_keys = ["controller", "method", "action","format", "_method", "auth_token"]<br>
parts = []<br> params.each do |k,v|<br> next if non_keys.include?(k.to_s) || k.to_s.starts_with("fb") <br> parts << "#{k}=#{v}"<br> end<br> path + parts.join("&") <br>
end<div><div></div><div><br><br><br><br><br><div class="gmail_quote">On Tue, Aug 19, 2008 at 2:45 PM, David Clements <span dir="ltr"><<a href="mailto:david.g.clements@gmail.com" target="_blank">david.g.clements@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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.<br>
<br>
Dave<br>
<br>
Sent from my iPhone<br>
<br>
Dave<div><br>
<br>
<br>
On Aug 19, 2008, at 2:27 PM, "Ken Schroeder" <<a href="mailto:schroeder.ken@gmail.com" target="_blank">schroeder.ken@gmail.com</a>> wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>
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.<br>
</div><div>
_______________________________________________<br>
Facebooker-talk mailing list<br>
<a href="mailto:Facebooker-talk@rubyforge.org" target="_blank">Facebooker-talk@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/facebooker-talk" target="_blank">http://rubyforge.org/mailman/listinfo/facebooker-talk</a><br>
</div></blockquote>
</blockquote></div><br></div></div></div>
</blockquote></div></div></div><br></div>
</blockquote></div><br></div>