Created
November 30, 2010 01:09
-
-
Save MarkNijhof/720951 to your computer and use it in GitHub Desktop.
index.haml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- for article in @blog_dorsey.articles.select{|item| item[:published] }[0...5] | |
= haml :'_article_heading', :layout => false, :article => article <<< passing article to the second partial view? |
The #haml
method you're using here isn't part of Haml; it's part of the host framework (presumably Sinatra).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry for the late reply back: When I do the following it works fine:
= haml :'_article_heading', :layout => false
But when I try to pass some extra state to the new to be rendered partial view it breaks. But this works fine directly from Sinatra.
What I basically want is to loop through a list of items in the main view and display each item using a sub view. So the sub view needs to have the particular item presented to it.