README.md in the_comments-2.2.0 vs README.md in the_comments-2.2.1
- old
+ new
@@ -17,10 +17,14 @@
* Production-ready commenting system for Rails 4+
* Designed for preprocessors Sanitize, Textile, Markdawn etc.
### :books: [Documentation](docs/documentation.md)
+## If you have any questions
+
+Please before ask anything try to launch and play with **[Dummy App](spec/dummy_app)** in spec folder. Maybe example of integration will be better than any documentation. Thank you!
+
## How to start dummy app (screencast)
[](http://vk.com/video_ext.php?oid=49225742&id=166578209&hash=10be1dba625149bb&hd=3)
## Quick Start Installation
@@ -162,12 +166,24 @@
end
```
Please, read [documentation](docs/documentation.md) to learn more
-### 6. Assets install
+### 6. Controller's addon
+```ruby
+class ApplicationController < ActionController::Base
+ include TheComments::ViewToken
+
+ # Prevent CSRF attacks by raising an exception.
+ # For APIs, you may want to use :null_session instead.
+ protect_from_forgery with: :exception
+end
+```
+
+### 7. Assets install
+
**app/assets/stylesheets/application.css**
```css
/*
*= require the_comments
@@ -178,21 +194,21 @@
```js
//= require the_comments
```
-### 7. Controller code example
+### 8. Controller code example
**app/controllers/posts_controllers.rb**
```ruby
def show
@post = Post.find params[:id]
@comments = @post.comments.with_state([:draft, :published])
end
```
-### 8. View code example
+### 9. View code example
**app/views/posts/show.html.haml**
```haml
= render partial: 'the_comments/tree', locals: { commentable: @post, comments_tree: @comments }