Ok I need some expert advise here....
I have a Photo Album that has_many Photos... Common stuff right?
Where I need expert advise is I want the use to click the desired photo album... and then see one photo at a time...
Should that all be happening in the PhotoAlbum Controller? that's how I have it now but it's getting messy as I want to add comments
Here's my current def show:
class PhotoAlbumsController < ApplicationController
#Need to activate the Nav
@space = Space.find(params[:space_id])
@photoalbum = PhotoAlbum.find(params[:id])
@photos = @photoalbum.photos.paginate :page => params[:page], :per_page => 1
@photo = @photos
@comments = @photoalbum.comments.roots.order("created_at DESC")
respond_to do |format|
format.html
end
end
.
.
Then in the View:
<%= image_tag @photos.first.photo.url %>
<%= render :partial => 'comments/index',:locals => {:commentable=> @photo.first,:comments => @comments}%>
Problem here is Photo comments is showing Comments for the Album, but recording it for the photo...
I want comments per Photo - Not Album.. and think maybe my controller setup is funky?
Thank you!