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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7aa8a280d07c433cb22cd4db45ef5254b9b99d65
4
- data.tar.gz: a071e09907e6ddd289a5c582767346d3d5504459
3
+ metadata.gz: 30bc73733a56797cee4aa0d0191d4a9c02996c94
4
+ data.tar.gz: 2c9399be95617829dd16c2bf6a67497af44ed5c5
5
5
  SHA512:
6
- metadata.gz: cd570e054aea0c5bce7e5d2ef9dd121d7b24e6d426db01d70eb413fc4e9859eff795f59437f59aa82b30476367c786e8f4ad20b7ec7615d17546dbc33b6d818d
7
- data.tar.gz: 067227033d3824b8a8e2e67b17db09b51b76eed5775e2eea7cb4d41bfa27e43f8c9b697d42c47923567a7f3a859c8ecb72d9f65cadcb4649fcf225cf00f14a67
6
+ metadata.gz: f31b54cffe180e50ea6fbf1ad3ea7e6969bd8717f3c1dc8203a39344c51c0bb2884d1acbaf301e2806637354dd5e86d7ecddbc6fc06a534055437999c22a87c5
7
+ data.tar.gz: 5ba13a76528ca25efbee61f80ac10ed5956a3e45f00af92c15345dc80366073ac30aa250c88669f96f5ec02fd9a3bd7258cfac12d11b88cb8684c170c93af429
@@ -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
@@ -1,3 +1,3 @@
1
1
  module MorseAssetable
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -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.3
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-06-30 00:00:00.000000000 Z
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: []