Announcing the OpenLaszlo Rails Plugin

The OpenLaszlo Rails plugin makes it easy to use OpenLaszlo client-side applications with Rails. It includes generators and scaffolding for creating OpenLaszlo applications, connecting them to Rails REST controllers, and displaying them within Rails views.

For example, the following shell command will create a Rails model named Contact, a REST controller named ContactController, an OpenLaszlo application named applet, and a view named contact/applet.
[code]
> script/generate applet contact applet
[/code]

At this point the applet will automatically display records that it retrieves, via the controller, from the model.

h3. More Info

You can install the plugin in a rails application by using the Rails plugin script:
[code]
> script/plugin install svn://rubyforge.org/var/svn/laszlo-plugin/tags/openlaszlo
[/code]

The "OpenLaszlo plugin project page":http://laszlo-plugin.rubyforge.org/ contains additional documentation.

h3. It's that simple!

In fact, here is all you need to type, from start to finish, in order to (1) install the OpenLaszlo plugin and its dependencies, (2) create a Rails application, (3) create an OpenLaszlo application that is configured to display rows from a database table, (4) create a view that holds the OpenLaszlo application, and (5) create a controller for the application to talk to (using REST). This assumes you've already installed Ruby, Rails, MySQL (or another database), and OpenLaszlo.
[code]
> gem install ropenlaszlo
> rails contacts
> cd contacts
# (update config/database.yaml with your database configuration settings here)
> script/plugin install svn://rubyforge.org/var/svn/laszlo-plugin/tags/openlaszlo
> script/generate applet contact applet
> rake
> script/server
# open "http://localhost:3000/contacts/applet" in your browser
[/code]

Update: Changed the svn URL from install svn://rubyforge.org/var/svn/laszlo-plugin/trunk to install svn://rubyforge.org/var/svn/laszlo-plugin/tags/openlaszlo. The other URL still works, but may get you an untested version.

10 Responses to “Announcing the OpenLaszlo Rails Plugin”

  1. Jon Says:

    Woah, neato!

  2. RV Says:

    do you need to install any subversion plugin ? i am getting errors for both the svn URLs :
    script/plugin: No such file or directory - svn –version

  3. Tim Lucas Says:

    Cool… I was looking for an excuse to play with the Laszlo again.

  4. Cloudy Thinking by Ron K. Jeffries » Blog Archive » OpenLaszlo Rails Plugin Says:

    [...] It’s past my bedtime, but I just stumbled across the Laszlo on Rails phenomena. There’s a Google group, and more details on the project blog. [...]

  5. David Andrew Thompson Says:

    RV…

    Yes, you need to have an SVN client in order to download the plugins for Windows. Go to the following link for an SVN client.http://subversion.tigris.org/project_packages.html

  6. Rian Says:

    “script/plugin install svn://rubyforge.org/var/svn/laszlo-plugin/tags/openlaszlo” fails for me, returning instead the export command:

    export: Create an unversioned copy of a tree.
    usage: 1. export [-r REV] URL [PATH]
    2. export [-r REV] PATH1 [PATH2]
    etc…

    Have tried downgrading svn to 1.1.3 without any luck. The command works fine via Locomotive. Any ideas?

  7. Dan Kubb Says:

    I just upgraded to rails 1.1 and the script/plugin install command fails for me as well. In fact it fails for all URIs that start with svn://.. with http:// it works fine.

    Downgrading rails appears to fix the problem.

  8. Albert Says:

    Hello,
    Just wondering if anyone could help. I did something stupid and started my blog using a numerical archive system, and now I'd like to change it so that the post title is part of the URL for SEO reasons. Is there any Wordpress plugins that anyone knows of that could switch it without sending Googlers to invalid pages? Maybe some sort of redirector to the correct page?

    Thanks.

  9. ktolis’ weblog » Rails OpenLaszlo Says:

    [...] I am trying to get things to work. I need to setup a rails enviroment on my mac and on my pc (first on my pc maybe) that co-works with OpenLaszlo. I already have on the pc Laszlo and Rails running and i need to get into some more reading regarding the bridging of these technologies. Here are some links for later: OL blog entry on the plugin: http://weblog.openlaszlo.org/archives/2006/01/announcing-the-openlaszlo-rails-plugin/ OL-Rails documentation reference: http://laszlo-plugin.rubyforge.org/ useless rails/laszlo info http://osteele.com/archives/2005/03/ruby-and-laszlo OL wiki entry regarding the use of the plugin http://wiki.openlaszlo.org/Laszlo_on_Rails [...]

  10. Raj Says:

    I have followed all the steps from above but my app doesn’t seem to retrieve any data from the database. Would appreciate any suggestions?

    Cheers