morse_assetable 0.1.3 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/morse_assetable.rb +22 -0
- data/lib/morse_assetable/version.rb +1 -1
- data/morse_assetable.gemspec +2 -3
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30bc73733a56797cee4aa0d0191d4a9c02996c94
|
4
|
+
data.tar.gz: 2c9399be95617829dd16c2bf6a67497af44ed5c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f31b54cffe180e50ea6fbf1ad3ea7e6969bd8717f3c1dc8203a39344c51c0bb2884d1acbaf301e2806637354dd5e86d7ecddbc6fc06a534055437999c22a87c5
|
7
|
+
data.tar.gz: 5ba13a76528ca25efbee61f80ac10ed5956a3e45f00af92c15345dc80366073ac30aa250c88669f96f5ec02fd9a3bd7258cfac12d11b88cb8684c170c93af429
|
data/lib/morse_assetable.rb
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
require "morse_assetable/version"
|
2
|
+
module MorseAssetableViewHelpers
|
3
|
+
def asset_input(f, i, bn = nil)
|
4
|
+
return multiple_assets(i, f) unless bn
|
5
|
+
asset = i.send(bn)
|
6
|
+
render partial: 'cms/assets/partials/asset',
|
7
|
+
locals: { asset: asset,
|
8
|
+
base_name: bn,
|
9
|
+
f: f }
|
10
|
+
end
|
11
|
+
|
12
|
+
def multiple_assets(i, f)
|
13
|
+
render partial: 'cms/assets/partials/assets',
|
14
|
+
locals: { assets: i.assets3,
|
15
|
+
f: f }
|
16
|
+
end
|
2
17
|
|
18
|
+
def nice_asset(a, version = nil)
|
19
|
+
return unless a && a.attachment
|
20
|
+
image_url = a.attachment.url
|
21
|
+
image_url = a.attachment.versions[version].url if version
|
22
|
+
image_tag image_url, alt: a.alt
|
23
|
+
end
|
24
|
+
end
|
3
25
|
# MorseAssetable
|
4
26
|
module MorseAssetable # rubocop:disable Metrics/ModuleLength
|
5
27
|
extend ActiveSupport::Concern
|
data/morse_assetable.gemspec
CHANGED
@@ -6,9 +6,8 @@ require 'morse_assetable/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "morse_assetable"
|
8
8
|
spec.version = MorseAssetable::VERSION
|
9
|
-
spec.authors = ["Terry S"]
|
10
|
-
spec.email = ["itsterry@gmail.com"]
|
11
|
-
|
9
|
+
spec.authors = ["Terry S", 'Fred Mac']
|
10
|
+
spec.email = ["itsterry@gmail.com", 'freddymcgroarty@gmail.com']
|
12
11
|
spec.summary = %q{ An easy way to handle submissions to carrierwave from a form }
|
13
12
|
spec.description = %q{ An easy way to handle submissions to carrierwave from a form }
|
14
13
|
spec.homepage = 'https://github.com/morsedigital/morse_assetable.git'
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: morse_assetable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Terry S
|
8
|
+
- Fred Mac
|
8
9
|
autorequire:
|
9
10
|
bindir: exe
|
10
11
|
cert_chain: []
|
11
|
-
date: 2016-
|
12
|
+
date: 2016-08-03 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: bundler
|
@@ -55,6 +56,7 @@ dependencies:
|
|
55
56
|
description: " An easy way to handle submissions to carrierwave from a form "
|
56
57
|
email:
|
57
58
|
- itsterry@gmail.com
|
59
|
+
- freddymcgroarty@gmail.com
|
58
60
|
executables: []
|
59
61
|
extensions: []
|
60
62
|
extra_rdoc_files: []
|