Hi, i've just met Haml (and i love it!), but i'm having problems
translating some erb views.
i usually have (erb) code like this:
<% content_for :onload_scripts do %>
$('#<%= highlighted_item %>').effect('highlight');
<% end %>
or
<% content_for :onload_scripts do %>
$('#search_items').autocomplete(
'<%= url_for :controller => '/items',
:action => 'search' %>', {
selectFirst: false,
minChars: 2
});
<% end %>
ie, to generate javascript with erb.
How can i write code like this in haml that doesn't suck? i think that
the only way to do this is with something respectively like:
- content_for :onload_scripts do
$('
= highlighted_item
').effectt('highlight');
- content_for :onload_scripts do
$('#search_items').autocomplete('
= url_for :controller => '/items', :action => 'search'
', {selectFirst: false, minChars: 2});
that's really ugly, don't you think? for now i'm using a
= render :partial => 'an_erb_file'
and putting all that stuff there, but that method sucks too :(
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---