simple_form_extension 1.4.16 → 1.4.17

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: b0923a6c64e3a373fe4cd5112d4f45c5e7ea3c2c
4
- data.tar.gz: b4545d0d4570bc4a9674a605d52989d504eaea4e
3
+ metadata.gz: '0880fda87e213f7de641ecfc0ca1a99537e4ca86'
4
+ data.tar.gz: 19de2b75fef0391593d598dc10fddfdf44c126f1
5
5
  SHA512:
6
- metadata.gz: 7d90c6780273260f670ea82c4936a5dac17f30ee2c39c27bec505f0fc61d628b700c0b810ef2f9c09e3e51d9e12afe2725af167caa89f641b3f014d3a3ef26ff
7
- data.tar.gz: 946edfa5efa417d9d78242eba9e3a4b449fabccfaba9287bb5ee4176675393f7980528e6cc281152243521f445a6ad516f619d9e65e08d296219ac8f1a4e4b61
6
+ metadata.gz: b9556a62fa16ae35cfb5e7ee041a40b3062414f77949051b4d467421c293a48d9bbeb364cf3de6a30cfea4bf448367ba99dee3f0453e231bc1221bd2c97a5e52
7
+ data.tar.gz: '004581a2f91da9b365764f4423021bc445654413db2d1afeebfdc684ac27395c1ba1593c31eda8cb42c7e4497451f6fb9b97095d44cb09244a249677161c3b6b'
data/README.md CHANGED
@@ -278,6 +278,20 @@ $.get('/form/url', function(response) {
278
278
  })
279
279
  ```
280
280
 
281
+ ## Disabling image input file type validation
282
+
283
+ By default, Simple Form Extension restricts the image file types users can
284
+ select to JPEG, PNG and GIF file types. This is done by using the `accept`
285
+ html attribute of the input tag.
286
+
287
+ You can turn off this behavior by :
288
+
289
+ - Setting `SimpleFormExtension.default_image_input_accept = nil` in an
290
+ initializer for an app-wide setting
291
+ - Setting `form.input :image, input_html: { accept: nil }` locally on the fields
292
+ you want to allow other input types
293
+
294
+
281
295
  ## Contributing
282
296
 
283
297
  1. Fork it ( http://github.com/xana68/simple_form_extension/fork )
@@ -19,6 +19,9 @@ module SimpleFormExtension
19
19
  #
20
20
  mattr_accessor :resource_name_methods
21
21
  @@resource_name_methods = [:name, :title]
22
+
23
+ mattr_accessor :default_image_input_accept
24
+ @@default_image_input_accept = "image/jpeg,image/png,image/gif"
22
25
  end
23
26
 
24
27
  SimpleForm::Inputs::Base.send(:include, SimpleFormExtension::Components::Icons)
@@ -8,6 +8,7 @@ module SimpleFormExtension
8
8
 
9
9
  def input(wrapper_options = nil)
10
10
  input_html_options[:class] << "image-upload"
11
+ input_html_options[:accept] ||= SimpleFormExtension.default_image_input_accept
11
12
 
12
13
  input_markup
13
14
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleFormExtension
2
- VERSION = "1.4.16"
2
+ VERSION = "1.4.17"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.16
4
+ version: 1.4.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Glyph-fr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-23 00:00:00.000000000 Z
11
+ date: 2019-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails