Created
March 25, 2009 23:48
-
-
Save seivan/85793 to your computer and use it in GitHub Desktop.
This file contains 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
class PhotoPicker # < Liquid::Tag | |
def initialize(tag_name, photo_pos, tokens) | |
super | |
@photo = photo_pos.to_i | |
end | |
def render(context) | |
#photos[@photo].image.url(:medium) | |
context['post'][@photo].image.url(:medium) | |
#rand(@photo) | |
end | |
end | |
Liquid::Template.register_tag('picture', PhotoPicker) | |
end | |
#index | |
<%= textilize(Liquid::Template.parse(post.content).render('post' => post.photos)) %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment