simple_form_fancy_uploads 0.1.1 → 0.2.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 275c198cbd4275e72eae27ae2eb6cf4d0fe533b1
|
4
|
+
data.tar.gz: 6f1f4b8c51cd8434789e23b040445cce1d1ed92b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b6f3aa9cc3151083e54d15af9ad005c359554ad9d06a1e52cba2db02c73b6dc70c0a4a982a4d91e724ec603eac6993d7f03cdddd207e0f3a5bcae8ad949fc15
|
7
|
+
data.tar.gz: 084c3bb12ad36ab7a45fdf024ca254caab030ce50faaf7b62feed0cc5e9432f358d4e21aaf7534042b75bacdfff3457660084a86e08813e6a68db30bf739cb1a
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# SimpleForm fancy uploads
|
2
2
|
|
3
|
-
A set of [simple_form](https://github.com/plataformatec/simple_form) (~> 3.
|
3
|
+
A set of [simple_form](https://github.com/plataformatec/simple_form) (~> 3.1) custom inputs to get image previews or a link to
|
4
4
|
uploaded file.
|
5
5
|
|
6
|
-
This gem uses the new simple_form 3.
|
6
|
+
This gem uses the new simple_form 3.1 ability to write your own form tags (check the [simple_form-bootstrap](https://github.com/rafaelfranca/simple_form-bootstrap) example). In 90% of cases, you need some kind of preview when it comes to uploaded files (avatar, images, docs, etc..), why should I write the same markup each time?
|
7
7
|
|
8
8
|
## What you get
|
9
9
|
|
@@ -40,7 +40,7 @@ If you need to fallback on Carrierwave's `#default_url` method to show a default
|
|
40
40
|
|
41
41
|
To get it work, you need:
|
42
42
|
|
43
|
-
* [simple_form](https://github.com/plataformatec/simple_form) ~> 3.
|
43
|
+
* [simple_form](https://github.com/plataformatec/simple_form) ~> 3.1 (*repetita iuvant*)
|
44
44
|
* [carrierwave](https://github.com/jnicklas/carrierwave) actually it's the most opinionated gem for uploads (thank you paperclip for the good times, but you know... life goes on)
|
45
45
|
* ruby 1.9+ (it uses some 1.9's syntax)
|
46
46
|
|
@@ -56,4 +56,4 @@ To get it work, you need:
|
|
56
56
|
* *the hard way:* repeat the above points, then show your power and send a pull request.
|
57
57
|
|
58
58
|
## License
|
59
|
-
Copyright (c)
|
59
|
+
Copyright (c) 2014 Andrea Pavoni http://andreapavoni.com
|
data/Rakefile
CHANGED
@@ -1,24 +1,15 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
|
+
|
2
3
|
begin
|
3
4
|
require 'bundler/setup'
|
4
5
|
rescue LoadError
|
5
6
|
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
7
|
end
|
7
|
-
begin
|
8
|
-
require 'rdoc/task'
|
9
|
-
rescue LoadError
|
10
|
-
require 'rdoc/rdoc'
|
11
|
-
require 'rake/rdoctask'
|
12
|
-
RDoc::Task = Rake::RDocTask
|
13
|
-
end
|
14
8
|
|
15
|
-
|
16
|
-
|
17
|
-
rdoc.title = 'SimpleFormFancyUploads'
|
18
|
-
rdoc.options << '--line-numbers'
|
19
|
-
rdoc.rdoc_files.include('README.rdoc')
|
20
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
|
-
end
|
9
|
+
require 'rspec/core'
|
10
|
+
require 'rspec/core/rake_task'
|
22
11
|
|
23
12
|
Bundler::GemHelper.install_tasks
|
13
|
+
RSpec::Core::RakeTask.new(:spec)
|
24
14
|
|
15
|
+
task :default => :spec
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module SimpleFormFancyUploads
|
2
2
|
class AttachmentPreviewInput < SimpleForm::Inputs::FileInput
|
3
|
-
def input
|
3
|
+
def input(wrapper_options=nil)
|
4
4
|
out = ''
|
5
5
|
if object.send("#{attribute_name}?")
|
6
6
|
out << template.link_to(object.send(attribute_name).filename, object.send(attribute_name).url)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_form_fancy_uploads
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrea Pavoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '3.
|
33
|
+
version: '3.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '3.
|
40
|
+
version: '3.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: carrierwave
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
version: '0'
|
88
88
|
requirements: []
|
89
89
|
rubyforge_project:
|
90
|
-
rubygems_version: 2.
|
90
|
+
rubygems_version: 2.4.5
|
91
91
|
signing_key:
|
92
92
|
specification_version: 4
|
93
93
|
summary: simple_form custom inputs to get image/link previews with file uploads.
|