attache_client 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d9aaa6578d9c8d8cc1d1f0035dc3c5e6e26bd37
4
- data.tar.gz: ee8085a4cf5bd23635fc28bf7308f0adbcb1bc96
3
+ metadata.gz: abdd59a8e946383476ec8c58434d94d6ce7bf6e7
4
+ data.tar.gz: 6000e846b291c03ac6e342a07542c3c5f576d48f
5
5
  SHA512:
6
- metadata.gz: 04641dbd477892eb63e024f6793f88fe16e0c8e925c3044924a031eae7df2ce8395564dd3af641c1e6a8da04631c58d6bc3fde7bc5b7d9a5d431b43a563c522f
7
- data.tar.gz: 227455a48ab4155e7ca2a9ea7fbf9266e4fc7a641bbd378f7686e7832d1963a9b0cb84c780f52820faca95610fee7f363ec494057411d96897bbc6156dfb572d
6
+ metadata.gz: dc24bb5c8b9258028c6c26f9a8f0c784a53df709db4d4f18160222bf6d9f1335eaa4b489673384a7b4d7cb79e6279bbf2f049fc0b891c8e4b5b675ef043ceaa6
7
+ data.tar.gz: 965fa0058c8317449d2c4681dc382a07758c62423a7797982079d2fad88b371f7ee90d54af048ca035ca48e1cb48402c866cd47e9efdc9691b71cc0bf2ff57fc
data/README.md CHANGED
@@ -82,6 +82,32 @@ Or if you're expecting multiple files uploaded, simply add `multiple: true`
82
82
 
83
83
  NOTE: `64x64#` is just an example, you should define a suitable [geometry](http://www.imagemagick.org/Usage/resize/) for your form
84
84
 
85
+ ### Strong Parameters
86
+
87
+ You'd need to permit the new field in your controller. For example, a strong parameters definition may look like this in your `Users` controller
88
+
89
+ ``` ruby
90
+ def user_params
91
+ params.require(:user).permit(:name)
92
+ end
93
+ ```
94
+
95
+ If you're only accepting a single file upload, change it to
96
+
97
+ ``` ruby
98
+ def user_params
99
+ params.require(:user).permit(:name, :photo_path)
100
+ end
101
+ ```
102
+
103
+ If you're accepting multiple file uploads via `multiple: true`, change it to
104
+
105
+ ``` ruby
106
+ def user_params
107
+ params.require(:user).permit(:name, photo_path: [])
108
+ end
109
+ ```
110
+
85
111
  ### Show
86
112
 
87
113
  Use the `attache_urls` helper to obtain full urls for the values you've captured in your database.
@@ -1,3 +1,3 @@
1
1
  module AttacheClient
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -6,7 +6,7 @@ module AttacheClient
6
6
  ATTACHE_DOWNLOAD_URL = ENV.fetch('ATTACHE_DOWNLOAD_URL') { 'http://localhost:9292/view' }
7
7
 
8
8
  def attache_urls(json, geometry)
9
- array = json.kind_of?(Array) ? json : [json]
9
+ array = json.kind_of?(Array) ? json : [*json]
10
10
  array.collect do |path|
11
11
  download_url = ATTACHE_DOWNLOAD_URL
12
12
  prefix, basename = File.split(path)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attache_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - choonkeat