upload-image 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -4
- data/app/assets/upload_image.js +1 -1
- data/lib/upload_image/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22b54fe2251df7de8f7d1601136ff83f71909d78
|
4
|
+
data.tar.gz: 1e46ee36eb3df515edcd80979644a58f82cb439a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fc7fca562cf1f4506a32a3bd8c98dc21c68818fbd7e0e483df0e9712c2828e04b58d134404687c8d6f7ea8e4114c219f8749a1e9be22a51b7b122f043c8643a
|
7
|
+
data.tar.gz: df620147c17b2951d8a4c6b1ffd39be95492b26bcbd1f23f9e6a29f987c4eae5156e5ff71c0ecf683475c54236deddf751f30a78cfd3c58d6a5e265995f4880f
|
data/README.md
CHANGED
@@ -14,28 +14,28 @@ Then you will get:
|
|
14
14
|
## Usage
|
15
15
|
There are some places you need to modify in your Rails app. For example:
|
16
16
|
|
17
|
-
|
17
|
+
- Model file
|
18
18
|
```ruby
|
19
19
|
class User < ApplicationRecord
|
20
20
|
mount_uploader :avatar, ImageUploader
|
21
21
|
include Croppable
|
22
22
|
end
|
23
23
|
```
|
24
|
-
|
24
|
+
- CarrierWave uploader file
|
25
25
|
```ruby
|
26
26
|
class ImageUploader < CarrierWave::Uploader::Base
|
27
27
|
include Croppable
|
28
28
|
...
|
29
29
|
end
|
30
30
|
```
|
31
|
-
|
31
|
+
- Controller file
|
32
32
|
```ruby
|
33
33
|
class UsersController < ApplicationController
|
34
34
|
include Croppable
|
35
35
|
...
|
36
36
|
end
|
37
37
|
```
|
38
|
-
|
38
|
+
- View file
|
39
39
|
```ruby
|
40
40
|
<%= upload_image form: f, image_name: :avatar, width: 150, height: 150 %>
|
41
41
|
```
|
@@ -54,6 +54,12 @@ And then execute:
|
|
54
54
|
$ bundle
|
55
55
|
```
|
56
56
|
|
57
|
+
Add the require statement in your `config/application.rb`:
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
require 'upload_image'
|
61
|
+
```
|
62
|
+
|
57
63
|
## Contributing
|
58
64
|
Feel free to contribute.
|
59
65
|
|
data/app/assets/upload_image.js
CHANGED
data/lib/upload_image/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: upload-image
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Li Dong
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|