Read more

Multi-line Ruby block in Haml

Henning Koch
November 03, 2011Software engineer at makandra GmbH

There are several options Show archive.org snapshot , but most of them are impractical. The best way is to use the :ruby filter:

:ruby
  puts javascript_include_tag(
    'lib/jquery-1.6.1.min.js',
    'lib/jquery-rails-ujs.js',
    'lib/jquery-ui-1.8.13.custom.min.js',
    'lib/jquery.ui.datepicker-de.js',
    'lib/jquery-ui-timepicker-addon.min.js',
    'lib/jquery.tools.min.js',
    'application.js',
    'google-maps.js',
    :cache => true
  )
Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

Note that you need to use puts to pipe text into the response. From the Haml reference Show archive.org snapshot :

All output sent to $stdout, like with puts, is output into the Haml document.

Posted by Henning Koch to makandra dev (2011-11-03 19:22)