diff --git a/app/controllers/tags.rb b/app/controllers/tags.rb index dd3f74f..8b7f5d6 100644 --- a/app/controllers/tags.rb +++ b/app/controllers/tags.rb @@ -10,8 +10,9 @@ class Tags < Application raise NotFound unless @tag @pages = @tag.pages @albums = @tag.albums + @photos = @tag.photos @secondary_title = "Content tagged with #{@tag.name}" - display @tag + render end def new diff --git a/app/views/albums/_albums.html.erb b/app/views/albums/_albums.html.erb new file mode 100644 index 0000000..6fb1526 --- /dev/null +++ b/app/views/albums/_albums.html.erb @@ -0,0 +1,13 @@ +<% if albums.nil? or albums.empty? -%> +
There were no albums found!
+<% else -%> + +<% albums.each_with_index do |album, index| -%> +<%= album.name -%> (<%= album.photos.size -%> photos)
+ <% if album.album_thumbnail -%><% end -%> +There were no photos found!
+<% else -%> + +<% photos.each_with_index do |photo, idx| -%> + + <% if (idx + 1) % 3 == 0 or photos.last == photo -%>There were no albums found!
-<% else -%> - <% @albums.each_with_index do |album, index| -%> -<%= album.name -%> (<%= album.photos.size -%> photos)
- <% if album.album_thumbnail -%><% end -%> -None!
-<% else -%> -