simple_text 0.0.17 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +25 -0
- data/app/assets/stylesheets/simple_text/documents.css.scss +4 -0
- data/lib/simple_text/engine.rb +0 -2
- data/lib/simple_text/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 840d9da92b00626a852cc9c61f217d1db94b4395
|
4
|
+
data.tar.gz: 77822454a6a2ae30c2aa41b84b5818e39e378502
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 748d78721eaab520d5d2f62f3c2c87edc3a17402df044fb907312b91e352703dc23a7e3a4cb1a5f2afc08ad0a4639515417d74f8fc9fb03f44cddb731cb49098
|
7
|
+
data.tar.gz: 8fdde36697457167a63dc05b5538683da6bea29aa46296a317bb7518af1e8319a88bbd097ceb1335347ab1e07f4195f793e174156ab626360b83c4b60e249960
|
data/README.md
CHANGED
@@ -6,6 +6,7 @@ Generate the migration and run migrations:
|
|
6
6
|
rake simple_text:migrations:install
|
7
7
|
rake db:migrate
|
8
8
|
```
|
9
|
+
Which will generate a migration for the `documents` table.
|
9
10
|
|
10
11
|
Optionally, add the SimpleText css to your `application.css`
|
11
12
|
```Ruby
|
@@ -21,3 +22,27 @@ If you've created a document, add the public route to your routes:
|
|
21
22
|
```Ruby
|
22
23
|
get '/disclaimer', to: 'documents#show', name: 'disclaimer'
|
23
24
|
```
|
25
|
+
|
26
|
+
## Overriding the default controller
|
27
|
+
For certain functionality, overriding the `DocumentsController` is required, e.g. to make [Pundit](https://github.com/elabs/pundit) work:
|
28
|
+
```Ruby
|
29
|
+
class DocumentsController < SimpleText::DocumentsController
|
30
|
+
after_action :verify_authorized, :except => :index
|
31
|
+
after_action :verify_policy_scoped, :only => :index
|
32
|
+
after_action :make_authorized, except: :index
|
33
|
+
after_action :make_scoped, only: :index
|
34
|
+
|
35
|
+
def make_authorized
|
36
|
+
authorize @document
|
37
|
+
end
|
38
|
+
|
39
|
+
def make_scoped
|
40
|
+
policy_scope @documents
|
41
|
+
end
|
42
|
+
end
|
43
|
+
```
|
44
|
+
|
45
|
+
## Some TODO's
|
46
|
+
- Make the model name changable.
|
47
|
+
- Write tests.
|
48
|
+
- Make integration of [Whodunnit](https://github.com/fletcher91/whodunnit) optional via config
|
data/lib/simple_text/engine.rb
CHANGED
data/lib/simple_text/version.rb
CHANGED