1. Skip to navigation
  2. Skip to content

The ELC Community Blog

A knowledge exchange on Ruby on Rails and Agile Development


OpenSocial on Rails, finally 1.0

by Ryan Garver on December 17, 2007

Hooray! We have a 1.0 of our opensocial_container plugin. Pick it up here:

ruby script/plugin install http://opensocial.rubyforge.org/svn/plugin/tags/1_0_0/opensocial_container

I've also created a STABLE tag. If you want to use that use the following:

ruby script/plugin install http://opensocial.rubyforge.org/svn/plugin/tags/STABLE/opensocial_container

In this release I completely refactored the Javascript library to get around a weird bug in Prototype. Apparently synchronous Ajax (Sjax?) calls are a little buggy and occasionally don't return. Now all requests back to the server go through normal asynchronous requests. This could still use some tuning down the road, as the requests are still in sequence. Eventually I'll get them running in parallel and taking advantage of some client caching.

Another improvement is now the route addition no longer takes a subdomain, but rather a full hostname and the instance id is prepended as a subdomain of the provided host. So for example, if you put the following in your config/routes.rb file:

map.opensocial_container 'example.com'

The container will use the hostname of '.example.com'. So if my instance_id is 342, the IFRAME that is embedded will point to '342.example.com'. This will require some configuration on the part of your webserver to accept these subdomains. This is pretty ugly, and needs to be cleaned up, but it works for now. I modeled this off of the google.com/ig site which attaches these ids to gmodules.com.

Comments

Sam at 3:16 PM on December 26 2007

I’m a newbie, just found that you had provided this great work.

But can you tell me should I create a rails project first so to install the plugin?

Mike at 12:14 AM on January 7 2008

Sam, yes you need to start a Rails project and run script/plugin install from the project root. Then it will be in your vendor/plugins directory.

Charles Melbye at 10:20 PM on August 17 2008

This isn’t working for all for me. First of all, how do I get the “instance” variable as shown in the example usage line?

Charles Melbye at 10:46 PM on August 17 2008

I’ve read another post of how to fix the instance problem, now I’m getting this when I try to visit the container URL (http://5.contain.opensocial.local:80/container?sess=blahblahblah):

Routing Error

No route matches ”/container” with {:method=>:get}

any ideas?

Mike Fair at 10:19 AM on August 27 2008

Hi, I’ve been trying to get an opensocial container working on a site. I have added the application http://www.google.com/ig/modules/datetime.xml but it has a javascript error saying _gel is undefined in firebug. Whee exactly is _gel supposed to be defined? thanks

Add a comment


home | services | Ruby on Rails Development | code | blog | company