OK. If you are that far along. Then you may want to create a votes table something similar to as I show below:
votes: id - int - created by rails in migrations question_id, even_id, ... whatever you are trying to track a user vote on user_id - foreign key from your users table voted_on - if you want to explicitly record the time and date Note that you may or may not want to create voted on explicitly since if you are using Rails 2.1.0, it will automatically create created_at, and updated_at giving you the same functionality (more since you have updated_at field too). Before saving a user's vote, you want to check in this table (write a validation function in the controller using before_filter) if the user has already voted on this question (or event or whatever you are tracking). If you find an existing record then simply display a flash message and return false. I cannot write the code for you, but here is one approach to solving this problem. Give it a try. Bharat On Oct 23, 2:14 am, Leximo <[EMAIL PROTECTED]> wrote: > Actually I have the Simply Rails 2 book and the Restful_Authentication > plugin installed on my app in addition to the open-id. > > The problem is adding the unique voting. I'll take a look at adding an > extra field. > > On Oct 22, 9:59 am, Robert Walker <[EMAIL PROTECTED]> > wrote: > > > > > You should also keep in mind that most ISPs use dynamically assigned IP > > addresses that can change at any time for the same user. > > > I agree that you must be able to identify the person. Cookies are > > insufficient. They can be easily cleared by the user. I use Safari, most > > of the time, and I reset it often which quickly and conveniently clears > > all cookies. > > > As another option you could track people by using OpenID if you don't > > want to take on the hassles of usernames and passwords. This is what > > stackoverflow.com is doing. > > > I think OpenID a great idea. But, there is a trade-off there. Setting up > > an OpenID initially adds even more complication to the end user than a > > username and password. The difference is that it's a one-time > > complication. The benefit to the end user is that they don't have to > > remember 20 passwords for 20 sites. So they will be able to use their > > OpenID on many other sites that support it. And for current OpenID users > > it involves much less complication. They only need to enter their OpenID > > URL and that's it. All you have to do is validate their OpenID. > > > There's a nice OpenID gem "ruby-openid" that should make implement it > > fairly painless. > > > Bharat Ruparel wrote: > > > I think that you want to build in an authentication system first > > > (restful_authentication) so that you can reliably identify who the user > > > is. After that it is a simple matter of logging a record in a table > > > that identifies that a user has voted on a specific word. So always > > > check beforehand if a user has voted on a word and then disallow > > > repeated voting. > > > People move around and identifying a user using just the IP address > > > alone is not sufficient in my opinion. > > > Hope this helps. > > > Regards, > > > Bharat > > > -- > > Posted viahttp://www.ruby-forum.com/.- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

