simple_form_bs5_file_input 0.0.3 → 0.0.4
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/Gemfile.lock +1 -1
- data/README.md +6 -4
- data/lib/has_one_attached_deletable.rb +2 -2
- data/lib/simple_form_bs5_file_input/version.rb +1 -1
- data/pkg/simple_form_bs5_file_input-0.0.3.gem +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d29fda2259cc709bc0c29343872315bf683701079f98f837c83b172dde85b64e
|
|
4
|
+
data.tar.gz: 9f2c839c7c9b4d0e74e039264073c06aea2e2d6c6f6acc5b8a89e0ce69f4e8ab
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d43df612085b487e3c0a6a6507a60212e8b72eed6f0ca91c02213551b3021f369158a04472452b60539aab08e73643abd614b180f0f225c8aa503740e2da9f5b
|
|
7
|
+
data.tar.gz: '08da174641d2797e0e96cd56e1c0f1b2fe79b666bfebddfedb3128702ad72ae56854056e981e558f0152fefe568d8b8ad2ba2a5971b441ff4f544e2aab103b84'
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -104,21 +104,23 @@ Direct upload will send the file BEFORE the page submission. You will get a prog
|
|
|
104
104
|
## Resize
|
|
105
105
|
|
|
106
106
|
You can add an option to the field to resize the image after upload (of course it has to be an image!).
|
|
107
|
+
|
|
107
108
|
Add `resize: true` to your field.
|
|
108
|
-
|
|
109
|
+
|
|
110
|
+
You can also specify a ratio for the cropper. For example `resize: 1` will lock the aspect ratio to a square. Beware of the float constraints in rails. If you want a 4/3 ratio use `resize: 4/3.to_f` as 4/3 otherwise gives 1.
|
|
109
111
|
|
|
110
112
|
|
|
111
|
-
The resizer is based on [CropperJS](https://github.com/fengyuanchen/cropperjs) so you have to add cropper and jquery-cropper to your dependencies
|
|
113
|
+
The resizer is based on [CropperJS](https://github.com/fengyuanchen/cropperjs) so you have to add cropper and jquery-cropper to your dependencies:
|
|
112
114
|
```
|
|
113
115
|
yarn add cropperjs
|
|
114
116
|
yarn add jquery-cropper
|
|
115
117
|
```
|
|
116
|
-
then include the js files in your application.js file
|
|
118
|
+
then include the js files in your application.js file:
|
|
117
119
|
```
|
|
118
120
|
//= require cropperjs/dist/cropper
|
|
119
121
|
//= require jquery-cropper/dist/jquery-cropper
|
|
120
122
|
```
|
|
121
|
-
and include the css in your application.sass file
|
|
123
|
+
and include the css in your application.sass file:
|
|
122
124
|
```
|
|
123
125
|
@import 'cropperjs/dist/cropper'
|
|
124
126
|
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
class ActiveRecord::Base
|
|
2
|
-
def self.has_one_attached_deletable(name,
|
|
2
|
+
def self.has_one_attached_deletable(name, **options)
|
|
3
3
|
class_eval do
|
|
4
4
|
attr_accessor :"#{name}_delete"
|
|
5
5
|
attr_accessor :"#{name}_infos"
|
|
@@ -49,6 +49,6 @@ class ActiveRecord::Base
|
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
-
has_one_attached name
|
|
52
|
+
has_one_attached name, **options
|
|
53
53
|
end
|
|
54
54
|
end
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: simple_form_bs5_file_input
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pierre-andré Boissinot
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-11-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -90,6 +90,7 @@ files:
|
|
|
90
90
|
- lib/simple_form_bs5_file_input/version.rb
|
|
91
91
|
- pkg/simple_form_bs5_file_input-0.0.1.gem
|
|
92
92
|
- pkg/simple_form_bs5_file_input-0.0.2.gem
|
|
93
|
+
- pkg/simple_form_bs5_file_input-0.0.3.gem
|
|
93
94
|
- simple_form_bs5_file_input.gemspec
|
|
94
95
|
homepage: https://github.com/noesya/simple_form_bs5_file_input
|
|
95
96
|
licenses:
|