Guest User

Untitled

a guest
May 26th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. # snippet from app/views/layout/application.haml
  2.  
  3. #list_tracks
  4. - if(!@tracks_by_keywords.nil?)
  5. = render :partial => "shared/list_tracks", :locals => {:tracks => @tracks_by_keywords}
  6. - elsif(!@tracks_by_category.nil?)
  7. = render :partial => "shared/list_tracks", :locals => {:tracks => @tracks_by_category}
  8. - elsif(!@tracks.nil?)
  9. = render :partial => "shared/list_tracks", :locals => {:tracks => @tracks}
  10.  
  11. # gives me the error:
  12.  
  13. compile error
  14. ......./app/views/layouts/application.haml:51: syntax error, unexpected kELSIF, expecting kEND
  15. haml_temp = _hamlout.push_script(haml_temp, false, false, false, false, false);end; elsif(!@tracks_by_category.nil?);
  16. ^
  17. ......./app/views/layouts/application.haml:53: syntax error, unexpected kELSIF, expecting $end
  18. haml_temp = _hamlout.push_script(haml_temp, false, false, false, false, false);end; elsif(!@tracks.nil?);
  19.  
  20. # now, when i change the "elsif" to "if" everything works fine, so i guess my syntax in general is valid only i use "elsif" the wrong way?
Add Comment
Please, Sign In to add comment