Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/carakan/like_comments
plugin for enabled like and comments for objects, like facebook
https://github.com/carakan/like_comments
Last synced: 15 days ago
JSON representation
plugin for enabled like and comments for objects, like facebook
- Host: GitHub
- URL: https://github.com/carakan/like_comments
- Owner: carakan
- Created: 2009-08-24T14:20:47.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2009-08-25T16:46:19.000Z (over 15 years ago)
- Last Synced: 2023-04-11T13:48:03.969Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 78.1 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
== LikeComments
Likes_comments is a plugin engine for enabled comments and likes a item, similar to facebook.
== Install:
Rails
* To install as a plugin:
script/plugin install http://github.com/carakan/like_comments
* Run /script/generate acts_as_commentable_migration (creates de file migration)
* (Optional) creates in the model to enabled like_comments the two columns :likes_counter, :comments_count, for example:
add_column :posts, :comments_count, :integer, :default => 0
add_column :posts, :likes_count, :integer, :default => 0== Usage
* Make your ActiveRecord model act as commentable.class Model < ActiveRecord::Base
acts_like_comments
end* Add a comment to a model instance
model = Model.new
comment = Comment.new
comment.comment = 'Some comment'
model.comments << comment* This plugin is engine enabled, use de partial located in like_comments/app/views/comments/_comments.html.erb
and use in the show for element:<%= render :partial => '/comments/comments', :locals => {:commentable => @obj} %>
* This template is overwrite, then copy in the your templates and use it.
== Credits
Juixe - This plugin is heavily influenced by ActsAsCommentable.
Tog - Plataform for creates social network.== More
info: carakan(at)gmail.com
page: http://carakan.com