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.

Add a comment


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