rails_admin_content_builder_rails_6 1.0.1 → 1.1.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdae3347024b3bb9b284b9b343de4a4350fefb68ec3cbaa85c5755e3ef0d8b19
|
4
|
+
data.tar.gz: 4c333bddf05f3849803154a0d00641e01c263ac555ae8450baf518451ee0664b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7c302ce3916a859ce3137ad7148ec74b59d659026b3071ab0bdcb34d9edbca797a69be87b4e696fdb7c2ea2f96355353e311e305d27f5d189c4527f56a1093f
|
7
|
+
data.tar.gz: 46264d8f2cfdb41a371abff6ab0d9fca33306e9f0bcf2663cbee2dbed47f2012c2cfa53b53fbf5e39509d94b7c2839ccae80e55d96c105457ba17f804784ca9f
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# RailsAdminContentBuilderRails6
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/rails_admin_content_builder_rails_6.svg)](https://badge.fury.io/rb/rails_admin_content_builder_rails_6)
|
4
|
+
|
3
5
|
Easy way for create contents using [rails_admin](https://github.com/sferik/rails_admin).
|
4
6
|
This gem is an update of [rails_admin_content_builder](https://github.com/luizpicolo/rails_admin_content_builder), it has bugfixes, improvements and now works on Rails 6.
|
5
7
|
|
@@ -35,6 +37,22 @@ Run the generator and migrations
|
|
35
37
|
rails g rails_admin_content_builder
|
36
38
|
rake db:migrate
|
37
39
|
|
40
|
+
After running the generator, set the module like this in `config -> initializers -> carrierwave.rb`. This is used to low the quality of the image, leaving it light and you can use for all uploaders.
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
module CarrierWave
|
44
|
+
module MiniMagick
|
45
|
+
def quality(percentage)
|
46
|
+
manipulate! do |img|
|
47
|
+
img.quality(percentage.to_s)
|
48
|
+
img = yield(img) if block_given?
|
49
|
+
img
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
```
|
55
|
+
|
38
56
|
Add styles in app/assets/application.scss
|
39
57
|
|
40
58
|
```ruby
|
data/lib/rails_admin_content_builder_rails_6/generators/templates/content_builder_image_uploader.rb
CHANGED
@@ -35,28 +35,14 @@ class ContentBuilderImageUploader < CarrierWave::Uploader::Base
|
|
35
35
|
|
36
36
|
# Create different versions of your uploaded files:
|
37
37
|
# Use quality to compress the image
|
38
|
-
# resize_to_limit - Resize the image to fit within the specified dimensions while
|
39
|
-
# retaining the original aspect ratio. Will only resize the image if it is larger
|
40
|
-
# than the specified dimensions. The resulting image may be shorter or narrower
|
41
|
-
# than specified in the smaller dimension but will not be larger than the specified
|
42
|
-
# values.
|
43
|
-
# resize_to_fit - Resize the image to fit within the specified dimensions while
|
44
|
-
# retaining the original aspect ratio. The image may be shorter or narrower than
|
45
|
-
# specified in the smaller dimension but will not be larger than the specified values.
|
46
|
-
# resize_to_fill - Resize the image to fit within the specified dimensions while
|
47
|
-
# retaining the aspect ratio of the original image. If necessary, crop the image in
|
48
|
-
# the larger dimension. Optionally, a "gravity" may be specified, for example
|
49
|
-
# "Center", or "NorthEast".
|
50
|
-
# resize_and_pad - Resize the image to fit within the specified dimensions while
|
51
|
-
# retaining the original aspect ratio. If necessary, will pad the remaining area
|
52
|
-
# with the given color, which defaults to transparent (for gif and png, white
|
53
|
-
# for jpeg). Optionally, a "gravity" may be specified, as above.
|
54
38
|
version :left_or_right do
|
55
39
|
process resize_to_fit: [640, 360]
|
40
|
+
process quality: 80
|
56
41
|
end
|
57
42
|
|
58
43
|
version :center do
|
59
44
|
process resize_to_fit: [1280, 720]
|
45
|
+
process quality: 80
|
60
46
|
end
|
61
47
|
|
62
48
|
# Add a white list of extensions which are allowed to be uploaded.
|
@@ -12,6 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.description = "Easy way for create contents using rails_admin on Rails 6 now with improvements and bug fixes"
|
13
13
|
spec.homepage = "https://github.com/thefalked/rails_admin_content_builder_rails_6"
|
14
14
|
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
15
16
|
|
16
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
17
18
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_admin_content_builder_rails_6
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giuliano Crivelli
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -403,7 +403,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
403
403
|
requirements:
|
404
404
|
- - ">="
|
405
405
|
- !ruby/object:Gem::Version
|
406
|
-
version:
|
406
|
+
version: 2.5.0
|
407
407
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
408
408
|
requirements:
|
409
409
|
- - ">="
|