cells-slim 0.0.5 → 0.0.6
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 +5 -5
- data/.travis.yml +2 -3
- data/CHANGES.md +5 -0
- data/README.md +33 -1
- data/lib/cell/slim/rails.rb +4 -4
- data/lib/cell/slim/version.rb +1 -1
- data/lib/cells-slim.rb +2 -1
- data/test/test_helper.rb +0 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f0b5b27149489ac1f463ca7aafd322561c88edaca5dcf89c1449cc560c1d9c3e
|
4
|
+
data.tar.gz: 9ef5b16f43aade60de28631ec83b085fa8c834266d52c29ed51261aca4c8acb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6faa7c49ae0948e26b1cbbe4add6d53ebb12a6d35c75e8dd8c39af967d0d33780510730659c9b0dba096fd6e460bb6f685c32345026820b6408a6ee9bb5ed044
|
7
|
+
data.tar.gz: 40112c9d040e15a4144f676af28f204f5c831979381c1690730b90a87b0b6037be763216b758570ac2f0df2d4d308bbfa83ef236820f9a55fc47e4d73d8d0d4e
|
data/.travis.yml
CHANGED
data/CHANGES.md
CHANGED
data/README.md
CHANGED
@@ -19,6 +19,38 @@ class CommentCell < Cell::ViewModel
|
|
19
19
|
include Cell::Slim
|
20
20
|
```
|
21
21
|
|
22
|
+
## Important
|
23
|
+
|
24
|
+
Cells Slim change default settings for Slim and disables escaping in templates.
|
25
|
+
To re-enable it, you can use below snippet:
|
26
|
+
|
27
|
+
It can be changed easy by override **template_options_for** from **Cells::Slim**:
|
28
|
+
```ruby
|
29
|
+
module Cell
|
30
|
+
module Slim
|
31
|
+
def template_options_for(options)
|
32
|
+
{
|
33
|
+
template_class: ::Slim::Template,
|
34
|
+
suffix: 'slim',
|
35
|
+
disable_escape: false,
|
36
|
+
escape_code: false,
|
37
|
+
use_html_safe: false, # set true for Rails
|
38
|
+
buffer: '@output_buffer'
|
39
|
+
}
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
```
|
44
|
+
|
45
|
+
This can be put in **config/application.rb**.
|
46
|
+
|
47
|
+
**Remember** that you need to use '==' instead of '=' ([reference in Slim docs](http://www.rubydoc.info/gems/slim/frames#Output_without_HTML_escaping___)) in your templates for code which should not be escaped, for example form_builder (notice that only from_for line require '=='):
|
48
|
+
```
|
49
|
+
== form_for model, url: users_path, method: method do |f|
|
50
|
+
= f.text_field :first_name
|
51
|
+
= f.text_field :last_name
|
52
|
+
```
|
53
|
+
|
22
54
|
## Documentation
|
23
55
|
|
24
|
-
[More documentation](http://
|
56
|
+
[More documentation](http://trailblazer.to/gems/cells/templates.html) can be found on the Trailblazer page.
|
data/lib/cell/slim/rails.rb
CHANGED
@@ -37,12 +37,12 @@ module Cell
|
|
37
37
|
"#{tag(:form, html_options, true) + extra_tags}"
|
38
38
|
end
|
39
39
|
|
40
|
-
def
|
41
|
-
super(options, true)
|
40
|
+
def tag(name = nil, options = nil, open = false, escape = true)
|
41
|
+
super(name, options, open, true)
|
42
42
|
end
|
43
43
|
|
44
|
-
def
|
45
|
-
super(name,
|
44
|
+
def content_tag(name, content_or_options_with_block = nil, options = nil, escape = true, &block)
|
45
|
+
super(name, content_or_options_with_block, options, false, &block)
|
46
46
|
end
|
47
47
|
|
48
48
|
def concat(string)
|
data/lib/cell/slim/version.rb
CHANGED
data/lib/cells-slim.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
require "
|
1
|
+
require "cells"
|
2
|
+
require "cell/slim"
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cells-slim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abdelkader Boudih
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-04-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cells
|
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
131
|
version: '0'
|
132
132
|
requirements: []
|
133
133
|
rubyforge_project:
|
134
|
-
rubygems_version: 2.
|
134
|
+
rubygems_version: 2.7.3
|
135
135
|
signing_key:
|
136
136
|
specification_version: 4
|
137
137
|
summary: Slim integration for Cells.
|