0

I finally got a chance to try to implement some simple ajax for a client, but have no idea where to start.

In my rails 3.1 app, my client wants to show a Like / Dislike poll.

It should show two links "Like" and "Dislike".

If a user clicks "Like", it would

  1. increment number_of_likes:integer in the database.
  2. display "You like this" under the links
  3. use a cookie to track their answer (so next tme they view the page it still says "You like this"

and, ideally, does this via ajax.

Sergio Tulentsev
  • 226,338
  • 43
  • 373
  • 367
jpw
  • 18,697
  • 25
  • 111
  • 187
  • So, what have you done already? – Sergio Tulentsev Jan 20 '12 at 07:21
  • "no idea where to start" so turned to SO for some getting started suggestions. Googled and watched some railscasts but they are all doing (seemingly) much more complex tasks so hoping to find a gentle "hello world" for ajax. Thx for the tips below. – jpw Jan 20 '12 at 09:49
  • Yet at the same time you provided a list of three items. Go and try to implement them. – Sergio Tulentsev Jan 20 '12 at 09:51

1 Answers1

1

Check this link out in SF

Best way to implement voting in a Rails application?

And if you think it, like, dis-like is also kind of voting, you with a little effort you should be able to get something up and running

Community
  • 1
  • 1
sameera207
  • 16,547
  • 19
  • 87
  • 152