开发者

is there a gem to create Twitter-like follow or is that a trivial :has_many?

was wondering if someone wanted a Twitter-like follow feature, is there a gem? I know there is one to handle "friends" but is following simply has_many or is there a gem which开发者_开发问答 would help with implementation (including the ajax/jquery portion?)


This is a plugin (not a gem), but it's rails3 compatible and is quite complete: https://github.com/tcocca/acts_as_follower/


Here is the answer step by step, first without Javascript, later using javascript. http://ruby.railstutorial.org/chapters/following-users#top


It could be implemented as a simple has_many, along with some simple POSTs to the server to actions 'follow' and 'unfollow' which would add/remove rows in the associated table.


I'm using socialization gem to do follow exactly like Twitter


I'm using acts_in_relation gem. I wrote the howto in my blog post.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜