Tom Dunn wrote:
> I'm creating a site that allows users to upload a picture. The picture
> they uploaded will be shown randomly for a period of time then another
> one will come on. When they upload it, they pay a certain price,
> depending on how many times they want it to be viewed.  I want it to be
> made that it's one dollar per amount of times it can be viewed.  Thus,
> if they pay $5, their picture will be shown 5 random times, but no more.
> My question is how to do this. I want to figure out how to make the data
> in the table delete itself after it is viewed the amount of times paid
> for. I'm not sure how to count the number of views nor make the data
> delete itself. Any help would be greatly appreciated!

you can do something like this
add column "picture_view" in database put value of it is equal to amount 
that user pay if  user pay $5 then make picture_view=5
then after each time picture shown reduce picture_views count by 1
if picture_view is 0(zero) then give such a condition that it will not 
be displayed
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to