Skip to content
mattetti edited this page Sep 12, 2010 · 9 revisions
  • Setup merb to handle laszlo requests

add the following to your after_app_loads block

Laszlo.url = “http://127.0.0.1:8080/lps-4.2.x” Merb.add_mime_type :swf, :to_swf, %w[application/x-shockwave-flash]
  • You need to install haml and the merb haml plugin
  • You need to download/checkout http://github.com/mcarlson/laszlo_post_api/tree/master and place it into the root of the lps (that’s the code that handles the magic of compiling at runtime) (It could be automated but it’s hard to figure out where your open-laszlo server is and it might be on a different machine)
  • put the resources in a resources directory directly in your views or for global ones app/views/resources
  • workflow:
  • you make your lzx/XML views using a regular template
  • inside your action you do laszlo(render)
  • when you hit the URL in dev mode, it does a bunch of magic and redirects you to the compiled version
  • layout
canvas{:width => "100", :height => “100%”, :bgcolor => "0xDDDDDD"} = lz :reload_button if Merb.environment == “development” = catch_content :for_layout
  • view:
  • start by defining your resources
    = lz :resource, “logo”, “laszlo_store_header.png”
    = lz :resource, “video”, “mediaplayer.png”

(resources being in app/views/resources)

  • setup your init block:
= lz :on, :init do :cdata gController.setAttribute(“appstate”, “Login to Main”);
  • ( see http://pastie.textmate.org/private/kn5qenzzflq3i7mbgg for more)
  • Deployment: Getting to the point where it’s easy to deploy SOLO HTML is still a task to do

Clone this wiki locally