i want to display the 3 last looks in the first row, then i want to display all others but without the 3 lasts looks.
This is my code
def index
query = params[:query].presence || "*"
conditions = {}
conditions[:available] = true
conditions[:look_tags] = params[:look_tags] if params[:look_tags].present?
@last_3_looks = Look.search query, where: conditions, order: { created_at: :desc }, limit: 3
@looks = Look.search query, where: conditions, order: { created_at: :desc }, page: params[:page], per_page: 8
end
the problem is if i put offset like below, i've got the same 8 looks at every pages, how to handle that please ?
@looks = Look.search query, where: conditions, order: { created_at: :desc }, page: params[:page], per_page: 8, offset: 3
end