decent_exposure 3.0.0.beta2 → 3.0.0
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/.travis.yml +1 -1
- data/README.md +41 -3
- data/gemfiles/{Gemfile.rails-5.0.0.rc1 → Gemfile.rails-5.0.0} +1 -1
- data/lib/decent_exposure.rb +4 -0
- data/lib/decent_exposure/version.rb +1 -1
- metadata +6 -7
- data/hashrocket_logo.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f8425a920206dc8af5e761d2f3f3783a7a7c6b4
|
4
|
+
data.tar.gz: b3f21e7fb044bf0b554cc26918d40ce84aa5b188
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbe1b3c1f9806de47df1a8ce1700d9ab5908c1981bc92fd1f63e528f4d60896556e9c9ede8b73b1966a047916158aaa33a141a3451aa4577a4cadf9da092ee2f
|
7
|
+
data.tar.gz: f50003ad917244794fdd3a767d9e18dc3d40ab22914a60f8efb7d77639facdf09e02436647821df43a0157ff0bb4f2332005275db419f784ab18dfc21a25bcad
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -18,7 +18,7 @@ Version `3.0` will support Rails 4 and 5.
|
|
18
18
|
Add this line to your application's Gemfile:
|
19
19
|
|
20
20
|
```ruby
|
21
|
-
gem 'decent_exposure', '3.0.0
|
21
|
+
gem 'decent_exposure', '3.0.0'
|
22
22
|
```
|
23
23
|
|
24
24
|
And then execute:
|
@@ -309,6 +309,7 @@ decoration process. Initially, this does nothing, but you can obviously change
|
|
309
309
|
that:
|
310
310
|
|
311
311
|
```ruby
|
312
|
+
expose :things, ->{ Thing.all.map{ |thing| ThingDecorator.new(thing) } }
|
312
313
|
expose :thing, decorate: ->(thing){ ThingDecorator.new(thing) }
|
313
314
|
```
|
314
315
|
|
@@ -325,6 +326,32 @@ expose :thing, with: [:cool_find, :cool_build]
|
|
325
326
|
expose :another_thing, with: :cool_build
|
326
327
|
```
|
327
328
|
|
329
|
+
## Rails Mailers
|
330
|
+
|
331
|
+
Mailers and Controllers use the save decent_exposure dsl.
|
332
|
+
|
333
|
+
### Example Mailer
|
334
|
+
|
335
|
+
```ruby
|
336
|
+
class PostMailer < ApplicationMailer
|
337
|
+
attr_accessor :post_id
|
338
|
+
|
339
|
+
expose(:posts, -> { Post.last(10) })
|
340
|
+
expose(:post, id: -> { post_id })
|
341
|
+
|
342
|
+
def top_posts
|
343
|
+
@greeting = "Top Posts"
|
344
|
+
mail to: "to@example.org"
|
345
|
+
end
|
346
|
+
|
347
|
+
def featured_post(post_id = nil)
|
348
|
+
self.post_id = post_id
|
349
|
+
@greeting = "Featured Post"
|
350
|
+
mail to: "to@example.org"
|
351
|
+
end
|
352
|
+
end
|
353
|
+
```
|
354
|
+
|
328
355
|
## Rails Scaffold Templates
|
329
356
|
|
330
357
|
If you want to generate rails scaffold templates prepared for `decent_exposure` run:
|
@@ -333,7 +360,18 @@ If you want to generate rails scaffold templates prepared for `decent_exposure`
|
|
333
360
|
rails generate decent_exposure:scaffold_templates [--template_engine erb|haml]
|
334
361
|
```
|
335
362
|
|
336
|
-
This will create the templates in your `lib/templates` folder.
|
363
|
+
This will create the templates in your `lib/templates` folder.
|
364
|
+
|
365
|
+
Make sure you have configured your templates engine for generators in `config/application.rb`:
|
366
|
+
|
367
|
+
```ruby
|
368
|
+
# config/application.rb
|
369
|
+
config.generators do |g|
|
370
|
+
g.template_engine :erb
|
371
|
+
end
|
372
|
+
```
|
373
|
+
|
374
|
+
Now you can run scaffold like:
|
337
375
|
|
338
376
|
```bash
|
339
377
|
rails generate scaffold post title description:text
|
@@ -349,6 +387,6 @@ rails generate scaffold post title description:text
|
|
349
387
|
|
350
388
|
## About
|
351
389
|
|
352
|
-
[](https://hashrocket.com)
|
353
391
|
|
354
392
|
Decent Exposure is supported by the team at [Hashrocket](https://hashrocket.com), a multidisciplinary design & development consultancy. If you'd like to [work with us](https://hashrocket.com/contact-us/hire-us) or [join our team](https://hashrocket.com/contact-us/jobs), don't hesitate to get in touch.
|
data/lib/decent_exposure.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decent_exposure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Pravosud
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-07-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -75,8 +75,7 @@ files:
|
|
75
75
|
- decent_exposure.png
|
76
76
|
- gemfiles/Gemfile.rails-4.2.0
|
77
77
|
- gemfiles/Gemfile.rails-4.2.6
|
78
|
-
- gemfiles/Gemfile.rails-5.0.0
|
79
|
-
- hashrocket_logo.png
|
78
|
+
- gemfiles/Gemfile.rails-5.0.0
|
80
79
|
- lib/decent_exposure.rb
|
81
80
|
- lib/decent_exposure/attribute.rb
|
82
81
|
- lib/decent_exposure/behavior.rb
|
@@ -118,12 +117,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
118
117
|
version: '2.0'
|
119
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
119
|
requirements:
|
121
|
-
- - "
|
120
|
+
- - ">="
|
122
121
|
- !ruby/object:Gem::Version
|
123
|
-
version:
|
122
|
+
version: '0'
|
124
123
|
requirements: []
|
125
124
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
125
|
+
rubygems_version: 2.5.1
|
127
126
|
signing_key:
|
128
127
|
specification_version: 4
|
129
128
|
summary: A helper for creating declarative interfaces in controllers
|
data/hashrocket_logo.png
DELETED
Binary file
|