Changeset 1271

Show
Ignore:
Timestamp:
07/28/08 16:44:10 (4 months ago)
Author:
alban
Message:

Support des tags dans les templates liquid. Refs #11

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/models/episode.rb

    r1268 r1271  
    3535  end 
    3636 
     37  def tags 
     38    @object.tag_list 
     39  end 
     40 
    3741end 
  • trunk/app/models/show.rb

    r1268 r1271  
    5252  end 
    5353 
     54  def tags 
     55    @show_tags ||= ShowTags.new(@object) 
     56  end 
     57 
    5458  def url_for 
    5559    view.url_for_show(@object) 
     
    6165 
    6266end 
     67 
     68class ShowTags < Liquid::Drop 
     69 
     70  def initialize(show) 
     71    @show = show 
     72  end 
     73 
     74  def [](key) 
     75    @show.episodes.find_tagged_with(key) 
     76  end 
     77 
     78end