THANK YOU!! Thats very clear and concise.

On Jul 6, 12:33 pm, kevinpfromnm <[email protected]> wrote:
> For the code, you probably want a card.  Then define your card to include
> the picture.   Check this recipe for an example of how to display a
> paperclip image in a card.  
> http://cookbook-staging.hobocentral.net/recipes/46-using-lightbox-wit...
>
> For the random selection I meant selecting the model with a find or scope,
> you want 1 item, :limit => 1, but a random selection from the whole
> collection, so :offset => some_random_number_between_0_and_the_max.  Once
> you have your item, you should be able to just add a card (after you adjust
> it to show the image) with that item as the context.
>
> In the controller:
> @image = ImageModelCount.find :first, :limit => 1, :offset =>
> rand(ImageModelName.count)
>
> There might be a cleaner way to do the offset without requiring the extra db
> hit with sql.
>
> In the view:
> <card with="&@image" />

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to