facebook app within a pre-existing application

瀏覽次數:150 次
跳到第一則未讀訊息

Karl

未讀,
2009年12月16日 上午11:05:462009/12/16
收件者:facebooker
I started developing facebook app within an existing app and I am
having some trouble with my links. I direct my canvas page
http://apps.facebook.com/karlbook/ to the
worth_causes_controller#index action:

http://localhost:3000/worthycauses/

Within my canvis page I have a link_to the
worthy_causes_controller#show action which looks like this on the
canvas page:

http://apps.facebook.com/karlbook/worthy_causes/1

Because my canvas defaults to /worthy_causes/, the request that comes
into rails looks like:

http://localhost:3000/worthycauses/worthycauses/1

Rails cannot find that path and throws an error.

I am having trouble understanding how to create links properly when
the canvas page does not map to the root route.

thx.

-karl



Mike Mangino

未讀,
2009年12月16日 上午11:40:372009/12/16
收件者:faceb...@googlegroups.com
Your callback url should go to the root of the rails app. We don't support pointing at only one controller. You can handle the root url using the :canvas routing conditional.

Mike
> --
>
> You received this message because you are subscribed to the Google Groups "facebooker" group.
> To post to this group, send email to faceb...@googlegroups.com.
> To unsubscribe from this group, send email to facebooker+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/facebooker?hl=en.
>
>

--
Mike Mangino
http://www.elevatedrails.com



Karl Baum

未讀,
2009年12月16日 上午11:55:072009/12/16
收件者:faceb...@googlegroups.com
My problem is that in my existing rails project, the root url is pointing at
the default location for our website. For backwards compatibility reasons,
I cannot point our canvas page at the root url. Is the only option then to
start a brand new rails project when developing using facebooker?

Also, I am not quite sure how the :canvas option helps.

Thanks for help!

-karl

Mike Mangino

未讀,
2009年12月16日 上午11:55:442009/12/16
收件者:faceb...@googlegroups.com

On Dec 16, 2009, at 11:55 AM, Karl Baum wrote:

> My problem is that in my existing rails project, the root url is pointing at
> the default location for our website. For backwards compatibility reasons,
> I cannot point our canvas page at the root url. Is the only option then to
> start a brand new rails project when developing using facebooker?

Sure you can. You can have / point to different controllers depending upon whether the route is from a canvas url or not. It's an option in the :conditions part of routing. It's covered in my book.

Mike

Karl Baum

未讀,
2009年12月16日 中午12:05:522009/12/16
收件者:faceb...@googlegroups.com
Oh ok. I will take a look at the book. Thanks again!

-karl
回覆所有人
回覆作者
轉寄
0 則新訊息