diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 0ce5713..07e608b 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,5 +1,5 @@ class HomeController < ApplicationController def index - @photo = Photo.featured.order('RANDOM()').first + @photos = Photo.featured.order('RANDOM()').limit(1) end end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 7489207..6be8d40 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,12 +1,12 @@ -<%= render 'shared/photo_styles', photos: [@photo], size: 17 %> +<%= render 'shared/photo_styles', photos: @photos, size: 17 %> <% content_for :navigation do %> <%= render 'shared/main_nav' %> <% end %> -<% if @photo %> -