elsif works fine in haml just the way you are using it. I think it boils
down to some syntax error in your code. usually a forgotten paren or curly
brace.
However, can I suggest that you simply dry up this code? You're doing the
same thing three times. Why not set an instance variable to the tracks you
want to list here and then call your partial once:
#list_tracks
= render :partial => "shared/list_track", :collection => @list_tracks
Chris
On Wed, Nov 5, 2008 at 5:29 AM, j0llyr0g3r <
[EMAIL PROTECTED]> wrote:
>
> Hey folks,
>
> there are quite some threads here dealing with the same problem, but
> so far, i couldn't find a solution to my problem:
>
> This haml-code:
>
> #list_tracks
> - if([EMAIL PROTECTED])
> = render :partial => "shared/list_tracks", :locals =>
> {:tracks => @tracks_by_keywords}
> - elsif([EMAIL PROTECTED])
> = render :partial => "shared/list_tracks", :locals =>
> {:tracks => @tracks_by_category}
> - elsif([EMAIL PROTECTED])
> = render :partial => "shared/list_tracks", :locals =>
> {:tracks => @tracks}
>
> gives me the following error:
>
> haml:82: syntax error, unexpected kELSIF, expecting kEND
> haml_temp = _hamlout.push_script(haml_temp, false, false, false,
> false, false);end; elsif([EMAIL PROTECTED]);
>
> Now if i change "elsif" to "if" everything works fine, but this code
> is clumpsy at best.
>
> To cut a long story short: How can i use "elsif" properly?
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---