Would it be better to have auctions have many bids and bids belong to auctions, or
Auction has one bid, bid belongs to auction?
Also, how would I call the bid object on the auction to change the :current_price attribute on auction, increment info it up by 1 dollar? Thanks for your help.
As for the bidding, I was thinking that instead of there being a highest bidder, I would simply have a button that the users could click that would increase the price by one dollar every time. Is there a way I could do this?
Clay
On 16 November 2014 16:11, Clay McCullough <cla...@kc.rr.com> wrote:
> Exactly. These are some problems I haven't figured out how to solve! This is my first web application. I have thought about all users clicking at the same time... What would be a good way to keep track of the users, have a record of the bidding, and increment the price the same amount every time? Would it be a method in the model or controller or what?
Please quote the previous message when replying and insert yourcomments at appropriate points, it makes it easier to follow the
thread. Otherwise someone seeing your previous message will have no
idea what you are saying 'exactly' to. Thanks.
Don't worry about where methods go yet, get the models and
associations sorted. It seems to me you are going to have to have
auctions, users, bids with appropriate associations. The +1 button
should not show +1 but show the new bid amount (current + 1) and that
value should be posted when he clicks, so there is no confusion over
the amount he is bidding. By keeping all the bids in the database
then you have a history of what happened.
You will need something like
user has many bids
auction has many bids
bid belongs to user
bid belongs to auction
Colin