Hello!
I have a photo_album which has several photos, IDs: 4,9,10,11,31 -- all for photo_album:3
I have the following for my DEF SHOW in my Photos controller:
@photo = @photoalbum.photos.order("created_at ASC").paginate :page => params[:page], :per_page => 1
Problem is, if the URL is: /photo_albums/3/photos/10 The code above starts at record 4, when I want it to start the will paginate at 10, like in the URL.
Anyone know how to set the starting ID in will_paginate?
Thanks
UPDATE
Also, noticing the PAGINATION links are rendering link this:
/photos/10?page=2&photo_album_id=3
When they should be rendering like:
/photo_albums/3/photos/?page=2
Does that sound right?
Here's the model info:
class PhotoAlbum < ActiveRecord::Base
has_many :photos, :dependent => :destroy
class Photo < ActiveRecord::Base
belongs_to :photo_album
Update 2 - Desired User Flow...
- #1 - User sees a list of photo albums
- #2, Users clicks a Photo Albums
- #3 User see a list of photos in the album
- #4 use views the clicked photo BUT has will_paginate showing and defaulted to the page number of the photo the user clicked
Update 3 - Controllers based on the flow
- Photo Albums per Project - PhotoAlbum Index
- Photos Per Photo Album - PhotoAlbum Show
- Photo Show - Photo Show
Does this sound right? Still at it, no luck yet. Appreciate any advice.