Trying to conver this to haml:

<% javascript_onload = yield(:javascript_onload) %>
<% unless javascript_onload.blank? %>
  <% javascript_tag do %>
    $(function(){
      <%= javascript_onload %>
    });
  <% end %>
<% end %>


First attempt:

-javascript_onload = yield(:javascript_onload)
- unless javascript_onload.blank?
  :javascript
    $(function(){
      = javascript_onload
    })

Results in:

    <script type='text/javascript'>
      //<![CDATA[
        $(function(){
          = javascript_onload
        })
      //]]>
    </script>

Second attempt looks like crap but works:

-javascript_onload = yield(:javascript_onload)
- unless javascript_onload.blank?
  :plain
    <script type='text/javascript'>
      //<![CDATA[
  = javascript_onload
  :plain
      //]]>
    </script>

Anyone have a better idea?

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to