<div dir="ltr">Cool.&nbsp; <br><br>1) new_api?&nbsp; is newish I think.<br><br>2) I think we have a custom starts_with , some legacy thing.&nbsp; <br><br>3) The next path is definitely kludgey.&nbsp; I&#39;d love to see what you have.<br><br>
Also, one note.&nbsp; If you notice the code that adds the &quot;/&quot; to the path.&nbsp; 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">&lt;<a href="mailto:schroeder.ken@gmail.com">schroeder.ken@gmail.com</a>&gt;</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?&nbsp; Is that in a newer facebooker release?<br><br>Also not sure if you know you have a typo with starts_with(&quot;fb&quot;) should be starts_with?(&quot;fb&quot;)&nbsp;&nbsp; <br>

<br>Additionally I modified how you handled the path creation to not use the action since restful paths don&#39;t contain show or index in the url which for my use would be the generally used method I need to reference this.&nbsp; 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">&lt;<a href="mailto:digidigo@gmail.com" target="_blank">digidigo@gmail.com</a>&gt;</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>&nbsp;# Override this so that we get redirected to the right place.&nbsp;&nbsp; <br>


&nbsp; def application_is_not_installed_by_facebook_user<br>&nbsp;&nbsp;&nbsp; redirect_to new_facebook_session.install_url(:next =&gt; next_path() )<br>&nbsp; end<br>&nbsp;<br>&nbsp;def next_path<br>&nbsp;&nbsp;&nbsp; path = &quot;#{params[:controller]}/#{params[:action]}?&quot;<br>


&nbsp;&nbsp;&nbsp; path = &quot;/#{path}&quot; unless Facebooker::FacebookAdapter.new_api? || Facebooker.is_for?(:bebo)<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; non_keys = [&quot;controller&quot;, &quot;method&quot;, &quot;action&quot;,&quot;format&quot;, &quot;_method&quot;, &quot;auth_token&quot;]<br>


&nbsp;&nbsp;&nbsp; parts = []<br>&nbsp;&nbsp;&nbsp; params.each do |k,v|<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; next if non_keys.include?(k.to_s) || k.to_s.starts_with(&quot;fb&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; parts &lt;&lt; &quot;#{k}=#{v}&quot;<br>&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; path + parts.join(&quot;&amp;&quot;)&nbsp;&nbsp;&nbsp;&nbsp; <br>


&nbsp; 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">&lt;<a href="mailto:david.g.clements@gmail.com" target="_blank">david.g.clements@gmail.com</a>&gt;</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. &nbsp;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, &quot;Ken Schroeder&quot; &lt;<a href="mailto:schroeder.ken@gmail.com" target="_blank">schroeder.ken@gmail.com</a>&gt; 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&#39;t yet added the application the filter chain ends up redirecting them to the main canvas page instead of the the group page directly. &nbsp;Is there a way to handle this if the user hasn&#39;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>