I’ve got list of project on the main page and some content. If user
clicks on one of the project i use ajax to update div with content with
project data. I’m displaying only one project at a time.
In index action i just collect all projects: @projects = Project.find(:all, :order => “date DESC”)
In show action i render project partial:
render :partial => “project”, :locals => {:project =>
Project.find(params[:id])} if params[:id]
How to create “next/previous project” links using ajax? I’ve looked at
“How to paginate with ajax”, but i can’t make it work.
Is it possible to somehow wait for images to be loaded and show updated
element afterwards? Now :complete event triggers, when all html data is
received, but browser still downloads images from the server.
If :conditions in paginate method is used not for finding current
element, but for filtering elements from the set to be used for
paginator, then it would explain why previous/next links are not
displayed.
But if it’s true, then how get specified (by params[:id]) element and
use paginate to display previous/next links to proper elements?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.