schneems/Likeable — Issue #10: Likes not added to redis
Author: cvrsor
Created: 2011-12-13 20:22:19+00:00
State: open

Hi,

I'm developing a rails3 application using RedisToGo Nano as my development environment and a Mini instance in Heroku for production. I have closely followed the provided Likeable sample application and added the _Likeable::UserMethods_ to my user model as well as the _Likeable module_ to my posts model (and also added the likes_controller.rb, routes.rb, and like_helper.rb code as appropriate).

Problem is some likes are registered in redis and some are not at all! The bad ones do not create a key at all, meaning, after clicking the _like_ link I run the REDIS.keys command and do not see anything relevant to the specific record.

I used the link tag provided in the _posts index view_ in the sample application. *Every time* I click the link, the POST request is executed correctly, it includes "resource_name"=>"Post", "resource_id"=>"XX" in the parameters, and returns a 'Success' notice as it should in my view.

My only deviation from the sample application is in the setup of redis, I did:
in config/environments/development.rb:
```ENV["REDISTOGO_URL"] = 'redis://username:password@myserver.redistogo.com:myport'
```

and in config/initializers/redis.rb
```uri = URI.parse(ENV["REDISTOGO_URL"])
REDIS = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
```

Any ideas?
Many thanks for your help,