Wednesday, January 20, 2010

[Rails] Re: Lightbox :/

Problem solved but it has raised another question:

The Lightbox is displayed on an index page that, on refresh, generates a
random image. To do this, I simply added a new model method:

def self.random
self.find(:first, :conditions => "display=1 AND picture1_id IS NOT
NULL", :order => "RAND()")
end

Next, I added the code to the view by defining: <% gallery =
Gallery.random %>

Obviously, this removes the scrolling capability of the Lightbox as the
group only consists of one instance: the randomly generated image. My
question is: How can I display one random image but have the ability to
scroll through images when in the Lightbox?
--
Posted via http://www.ruby-forum.com/.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate