| Module | AlbumsHelper |
| In: |
app/helpers/albums_helper.rb
|
# File app/helpers/albums_helper.rb, line 15
15: def cover_image_tag(album, size=:p234)
16: if album.cover_photo
17: image_tag album.cover_photo.version(size), :alt => album.title, :class => aspect(album.cover_photo)
18: else
19: image_tag "/images/album_cover.png", :alt => "Album", :class => "horizontal"
20: end
21: end
# File app/helpers/albums_helper.rb, line 2
2: def pretty_dates(starts_at, ends_at, locale=I18n.locale)
3: starts_on = starts_at.to_date
4: ends_on = ends_at.to_date
5: if starts_on.eql?(ends_on)
6: I18n.localize(starts_at.to_date, :format => :long, :locale => locale)
7: else
8: # Different dates
9: start_date = I18n.localize(starts_at.to_date, :format => :long, :locale => locale)
10: end_date = I18n.localize(ends_at.to_date, :format => :long, :locale => locale)
11: "#{start_date} - #{end_date}"
12: end
13: end