Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Formatting and link fixes.

  • Loading branch information...
commit f144418f39c224ef22dab7c1e62ace06bf545fe9 1 parent 5ac6d96
Jordan Running jrunning authored

Showing 1 changed file with 52 additions and 40 deletions. Show diff stats Hide diff stats

  1. +52 40 README.md
92 README.md
Source Rendered
... ... @@ -1,41 +1,49 @@
1   -Acts As Commentable (now with comment threads (TM)!!! -- kidding on the (TM))
  1 +Acts As Commentable (now with comment threads(TM)!!! -- kidding on the (TM))
2 2 ===================
3 3
4   -Allows for threaded comments to be added to multiple and different models. Drop-in compatible for acts_as_commentable (however requiring a database schema change)
  4 +Allows for threaded comments to be added to multiple and different models.
  5 +Drop-in compatible for acts_as_commentable (however requiring a database
  6 +schema change)
5 7
6 8 Requirements
7 9 ------------
8   -
9 10 This gem is for Rails 3 and later versions only.
10 11
11   -This gem depends on CollectiveIdea's Awesome Nested Set gem. It is installed if not already present when you install this gem.
  12 +This gem depends on CollectiveIdea's Awesome Nested Set gem. It is installed if
  13 +not already present when you install this gem.
  14 +
  15 +You can find the gem on GitHub at [collectiveidea/awesome_nested_set]
12 16
13   -You can find the gem on GitHub at https://github.com/collectiveidea/awesome_nested_set
  17 +[collectiveidea/awesome_nested_set]: https://github.com/collectiveidea/awesome_nested_set
14 18
15 19 Install
16 20 -------
  21 +In your Gemfile, add:
17 22
18   -In your Gemfile, add
19 23 gem 'acts_as_commentable_with_threading'
20 24
21 25 and run `bundle install`.
22 26
23 27 Migrations
24 28 ----------
25   -
26 29 * To install from scratch:
27 30
28   - `rails generate acts_as_commentable_with_threading_migration`
  31 + rails generate acts_as_commentable_with_threading_migration
29 32
30   - This will generate the migration script necessary for the table
  33 + This will generate the migration script necessary for the table
31 34
32   -* To upgrade to acts_as_commentable_with_threading from the old acts_as_commentable:
  35 +* To upgrade to acts_as_commentable_with_threading from the
  36 + old acts_as_commentable:
33 37
34   - `rails generate acts_as_commentable_upgrade_migration`
  38 + rails generate acts_as_commentable_upgrade_migration
35 39
36   - This will generate the necessary migration to upgrade your comments table to work with acts_as_commentable_with_threading
  40 + This will generate the necessary migration to upgrade your comments
  41 + table to work with acts_as_commentable_with_threading
37 42
38   -If the generators fail, you can just as easily create the migrations by hand. See the templates in the generators under `lib/generators`.
  43 +If the generators fail, you can just as easily create the migrations by hand.
  44 +See the templates in the generators under [`lib/generators`].
  45 +
  46 +[`lib/generators`]: https://github.com/elight/acts_as_commentable_with_threading/tree/master/lib/generators
39 47
40 48 Usage
41 49 -----
@@ -43,56 +51,60 @@ Usage
43 51 acts_as_commentable
44 52 end
45 53
46   -* Add a comment to a model instance, for example an Article
  54 +* Add a comment to a model instance, for example an Article:
47 55
48   - @article = Article.find(params[:id])
49   - @user_who_commented = @current_user
50   - @comment = Comment.build_from(@article, @user_who_commented.id, "Hey guys this is my comment!" )
  56 + @article = Article.find(params[:id])
  57 + @user_who_commented = @current_user
  58 + @comment = Comment.build_from( @article, @user_who_commented.id, "Hey guys this is my comment!" )
51 59
52   -* To make a newly created comment into a child/reply of another comment
  60 +* To make a newly created comment into a child/reply of another comment:
53 61
54   - comment.move_to_child_of(the_desired_parent_comment)
  62 + comment.move_to_child_of(the_desired_parent_comment)
55 63
56   -* To retrieve all comments for an article, including child comments
  64 +* To retrieve all comments for an article, including child comments:
57 65
58   - @all_comments = @article.comment_threads
  66 + @all_comments = @article.comment_threads
59 67
60   -* To retrieve only the root comments without their children comments
  68 +* To retrieve only the root comments without their child comments:
61 69
62   - @root_comments = @article.root_comments
  70 + @root_comments = @article.root_comments
63 71
64   -* To check if a comment has children
  72 +* To check if a comment has children:
65 73
66   - @comment.has_children?
  74 + @comment.has_children?
67 75
68   -* To verify the number of children a comment has
  76 +* To verify the number of children a comment has:
69 77
70   - @comment.children.size
  78 + @comment.children.size
71 79
72   -* To retrieve a comments children
  80 +* To retrieve a comment's children:
73 81
74   - @comment.children
  82 + @comment.children
75 83
  84 +* If you plan to use the `acts_as_voteable` plugin with your comment system be
  85 + sure to uncomment two things:
76 86
77   -*If you plan to use the acts_as_voteable plugin with your comment system be sure to uncomment two things:
  87 + * In `lib/comment.rb` uncomment the line [`acts_as_voteable`][L9].
78 88
79   -in `lib/comment.rb` uncomment the line `acts_as_voteable`
  89 + * In `lib/acts_as_commentable_with_threading.rb` uncomment the line
  90 + [`include Juixe::Acts::Voteable`][L5] near the top.
80 91
81   -in `lib/acts_as_commentable_with_threading.rb` uncomment the line `include Juixe::Acts::Voteable` near the top
  92 +[L9]: https://github.com/elight/acts_as_commentable_with_threading/blob/master/lib/generators/acts_as_commentable_with_threading_migration/templates/comment.rb#L9
  93 +[L5]: https://github.com/elight/acts_as_commentable_with_threading/blob/master/lib/acts_as_commentable_with_threading.rb#L5
82 94
83 95 Credits
84 96 -------
85   -xxx - For contributing the updates for Rails 3!
  97 +* [xxx](https://github.com/xxx) - For contributing the updates for Rails 3!
  98 +* [Jack Dempsey](https://github.com/jackdempsey) - This plugin/gem is heavily
  99 + influenced/liberally borrowed/stolen from [acts_as_commentable].
86 100
87   -Jack Dempsey - This plugin/gem is heavily influenced/liberally borrowed/stole from acts_as_commentable
  101 +And in turn...
88 102
89   -which in turn credits....
  103 +* Xelipe - Because acts_as_commentable was heavily influenced by Acts As Taggable.
90 104
91   -Xelipe - Because acts_as_commentable was heavily influenced by Acts As Taggable.
  105 +[acts_as_commentable]: https://github.com/jackdempsey/acts_as_commentable
92 106
93 107 More
94 108 ----
95   -
96   -[http://tripledogdare.net](http://tripledogdare.net)
97   -
98   -[http://evan.tiggerpalace.com](http://evan.tiggerpalace.com)
  109 +* [http://tripledogdare.net](http://tripledogdare.net)
  110 +* [http://evan.tiggerpalace.com](http://evan.tiggerpalace.com)

0 comments on commit f144418

Please sign in to comment.
Something went wrong with that request. Please try again.