README.md in the_comments-0.9.9 vs README.md in the_comments-1.0.0

- old
+ new

@@ -1,14 +1,12 @@ # TheComments 1.0.0 -TheComments - just comment system for my Ruby on Rails 4 projects +TheComments - just comment system for my Ruby on Rails 4 projects. [(rubygems)](http://rubygems.org/gems/the_comments) -P.S: and for me it's best prototype of comment system for Rails 4 - ## Keywords -Comments for Rails 4, Comments with threading, Nested Comments, Polymorphic comments, Acts as commentable, Comment functionality, Comments, Threading, Rails 4, Comments with moderation, I hate captcha for comments! +Comments for Rails 4, Comments with threading, Nested Comments, Polymorphic comments, Acts as commentable, Comment functionality, Comments, Threading, Rails 4, Comments with moderation, I hate captcha! ## Screenshots **click to zoom** @@ -19,15 +17,15 @@ <td width="20%">Edit</td> <td width="20%">Cache counters & User Cabinet</td> <td width="20%">Recent comments & Denormalization</td> </tr> <tr> - <td width="20%"><img width="100%" height="100%" src="https://raw.github.com/open-cook/the_comments/master/docs/the_comments_view_2.gif" alt="the_comments"></td> - <td width="20%"><img width="100%" height="100%" src="https://raw.github.com/open-cook/the_comments/master/docs/the_comments_view_1.gif" alt="the_comments"></td> - <td width="20%"><img width="100%" height="100%" src="https://raw.github.com/open-cook/the_comments/master/docs/the_comments_view_4.gif" alt="the_comments"></td> - <td width="20%"><img width="100%" height="100%" src="https://raw.github.com/open-cook/the_comments/master/docs/the_comments_view_3.gif" alt="the_comments"></td> - <td width="20%"><img width="100%" height="100%" src="https://raw.github.com/open-cook/the_comments/master/docs/the_comments_view_5.gif" alt="the_comments"></td> + <td width="20%"><img width="100%" height="100%" src="https://raw.github.com/the-teacher/the_comments/master/docs/the_comments_view_2.gif" alt="the_comments"></td> + <td width="20%"><img width="100%" height="100%" src="https://raw.github.com/the-teacher/the_comments/master/docs/the_comments_view_1.gif" alt="the_comments"></td> + <td width="20%"><img width="100%" height="100%" src="https://raw.github.com/the-teacher/the_comments/master/docs/the_comments_view_4.gif" alt="the_comments"></td> + <td width="20%"><img width="100%" height="100%" src="https://raw.github.com/the-teacher/the_comments/master/docs/the_comments_view_3.gif" alt="the_comments"></td> + <td width="20%"><img width="100%" height="100%" src="https://raw.github.com/the-teacher/the_comments/master/docs/the_comments_view_5.gif" alt="the_comments"></td> </tr> </table> ### Main features @@ -49,11 +47,13 @@ * [Customization](#customization) * [User methods](#user-methods) * [Commentable methods](#commentable-methods) * [Online Support](#online-support) * [About author](#about-author) +* [What about specs?](#what-about-specs) + ## Installation This gem has many steps to install. Be careful when installing and keep calm. Just follow an installation instruction step by step and everything will be fine! @@ -174,24 +174,26 @@ end ``` ### Any Commentable Model (Page, Blog, Article, User(!) ...) +Read more about **commentable_title**, **commentable_url** and **commentable_state** methods here: [Denormalization and Recent comments](#denormalization) + ```ruby class Blog < ActiveRecord::Base include TheCommentsCommentable def commentable_title - # by default: try(:title) || 'Undefined title' + # by default: try(:title) || TheComments.config.default_title # for example: "My first blog post" blog_post_name end def commentable_url # by default: ['', self.class.to_s.tableize, self.to_param].join('/') - # for example: "blogs/1-my-first-blog-post" - [self.class.to_s.tableize, slug_id].join('/') + # for example: "/blogs/1-my-first-blog-post" + ['', self.class.to_s.tableize, slug_id].join('/') end def commentable_state # by default: try(:state) # for example: "draft" @@ -200,10 +202,11 @@ end ``` ### Comment Model + ```ruby class Comment < ActiveRecord::Base include TheCommentsBase # Define comment's avatar url @@ -262,11 +265,11 @@ * Cache counters for commentable objects and User * Moderation for comments and simple Admin UI * Spam traps instead Captcha. *I hate Captcha* * Blacklists for IP and UserAgent * Denormalization for fast and Request-free Recent comments building -* Ready for external content filters (<b>sanitize</b>, <b>RedCloth</b>, <b>Markdown</b>) +* Ready for external content filters (<b>sanitize</b>, <b>RedCloth</b>, <b>Markdown</b>, etc) * Highlighting and Jumping to comment via anchor * Ready for Rails4 (and Rails::Engine) * Ready for JQuery 1.9+ * Delete without destroy @@ -277,11 +280,11 @@ * [Acts as commentable with threading](https://github.com/elight/acts_as_commentable_with_threading) - so, guys, where is the render helper for the tree? There is no helper! Should I make render helper for tree by myself? Nooooo!!! I'm so sorry, but I can't use this gem. * [acts_as_commentable](https://github.com/jackdempsey/acts_as_commentable) - so, I can see code for models. But I can't see code for controllers and views. Unfortunately, there is no threading. It's not enough for me. * [opinio](https://github.com/Draiken/opinio) - looks better, but there is no threading. I want to have more! * [has_threaded_comments](https://github.com/aarongough/has_threaded_comments) - Nice work! Nice gem! Models, controllers, views, view helper for tree rendering! **But**, last activity 2 years ago, I need few features, I think - I can make it better. -![TheComments](https://raw.github.com/open-cook/the_comments/master/docs/the_comments.jpg) +![TheComments](https://raw.github.com/the-teacher/the_comments/master/docs/the_comments.jpg) ## Comments, Posted comments, ComComs ### Posted comments @@ -342,25 +345,25 @@ ## Denormalization For building of Recent comments list (for polymorphic relationship) we need to have many additional requests to database. It's classic problem of polymorphic comments. -I use denormalization of commentable objects for solve of this problem. +I use denormalization of commentable objects to solve this problem. My practice shows - We need 3 denormalized fields into comment for (request-free) building of recent comments list: -<img src="https://raw.github.com/open-cook/the_comments/master/docs/the_comments_view_5.gif" alt="the_comments"> +<img src="https://raw.github.com/open-cook/the-teacher/master/docs/the_comments_view_5.gif" alt="the_comments"> * **Comment#commentable_title** - for example: "My first post about Ruby On Rails" * **Comment#commentable_url** - for example: "/posts/1-my-first-post-about-ruby-on-rails" * **Comment#commentable_state** - for example: "draft" That is why any **Commentable Model should have few methods** to provide denormalization for Comments. ## Recent comments building -Denormalization makes, building of Recent comments (for polymorphic relationship) is very easy! +Denormalization makes building of Recent comments (for polymorphic relationship) very easy! Controller: ```ruby @comments = Comment.with_state(:published) @@ -487,11 +490,22 @@ ## About author Yes, It's true - I was a school teacher in the past. That's why my login is the-teacher. -Now I'm ruby & frontend developer. +Now I'm ruby/frontend developer and [food-blogger](http://open-cook.ru). I learn, I teach, I make a code. And sorry for my English. + +## What about specs? + +This gem - just first prototype of my ideas about comment system. +Unfortunatly, I have no time to write many tests for this gem. +Release 1.0.0 works for my pet projects - it's enough for me. +If you have a problem with gem and you can to create coverage tests for this problem - I will be happy to get your pull request. + +### Where I can find example of application with the_comments? + +This gem is part of new version of my food-blog about modern russian home cuisine. There is code of my tasty CMS [open-cook](https://github.com/open-cook/open-cook) ## Contributing 1. Fork it 2. Clone it into local folder \ No newline at end of file