remotipart 0.2.0 → 0.2.1
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.
- data/History.rdoc +21 -0
- data/README.rdoc +18 -8
- data/VERSION +1 -1
- data/lib/remotipart.rb +2 -2
- data/remotipart.gemspec +3 -2
- metadata +4 -3
data/History.rdoc
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
= History
|
2
|
+
|
3
|
+
=== 0.2.1 / 2011-01-16
|
4
|
+
|
5
|
+
* Minor Enhancements
|
6
|
+
* Added support for passing text_area_tag options to remotipart_response. {GitHub Issue #7}[https://github.com/formasfunction/remotipart/issues#issue/7] - patch by {Todd Eichel}[https://github.com/tfe]
|
7
|
+
|
8
|
+
=== 0.2.0 / 2010-12-08
|
9
|
+
|
10
|
+
* Bug Fixes
|
11
|
+
* Added support for form action URLs that include GET params. {GitHub Issue #4}[https://github.com/formasfunction/remotipart/issues/closed#issue/4] - initial patch by ramontayag[https://github.com/ramontayag].
|
12
|
+
* Added proper HTML escaping for the remotipart_response textarea content. {GitHub Issue #5}[https://github.com/formasfunction/remotipart/issues/closed#issue/5] - patch by gucki[https://github.com/gucki].
|
13
|
+
|
14
|
+
=== 0.1.1 / 2010-08-27
|
15
|
+
|
16
|
+
* Bug Fixes
|
17
|
+
* Removed a call to the JS console. {GitHub Issue #1}[https://github.com/formasfunction/remotipart/issues/closed#issue/5] - reported by {Trevor Burnham}[https://github.com/TrevorBurnham].
|
18
|
+
|
19
|
+
=== 0.1.0 / 2010-04-09
|
20
|
+
|
21
|
+
* Initial Release
|
data/README.rdoc
CHANGED
@@ -13,20 +13,30 @@ This gem augments the native Rails jQuery remote form function enabling asynchro
|
|
13
13
|
== Installation
|
14
14
|
|
15
15
|
1. Install the Remotipart gem
|
16
|
-
|
16
|
+
|
17
|
+
gem install remotipart
|
18
|
+
|
17
19
|
2. Run the Remotipart generator to add jquery.remotipart.js to public/javascripts/
|
18
|
-
|
19
|
-
|
20
|
-
|
20
|
+
|
21
|
+
rails g remotipart
|
22
|
+
|
23
|
+
3. Add the Javascript files for jQuery, the Rails jQuery driver, jQuery Form plugin, and Remotipart to your template, making sure to include jquery.remotipart.js *after* jQuery and the Rails jQuery driver
|
24
|
+
|
25
|
+
<%= javascript_include_tag 'jquery-1.4.4.min', 'rails', 'jquery.form', 'jquery.remotipart' %>
|
21
26
|
|
22
27
|
== Usage
|
23
28
|
|
24
29
|
* For multipart / forms with file inputs, set your form_for to remote as you would for a normal ajax form:
|
25
|
-
|
30
|
+
:remote => true
|
26
31
|
* When Javascript is enabled in the user's browser, the form, including the file, will be submitted asynchronously to your controller with:
|
27
|
-
|
32
|
+
:format == 'js'
|
28
33
|
* In the JS response template for your controller action, wrap all of your response code in one remotipart_response block:
|
29
|
-
|
34
|
+
<%= remotipart_response do %> All Javascript response code goes here <% end %>
|
35
|
+
|
36
|
+
== Advanced Usage
|
37
|
+
|
38
|
+
* The options available to the text_area_tag[http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-text_area_tag] can be passed to remotipart_response for further control over the response. For instance:
|
39
|
+
<%= remotipart_response({:escape => false}) do %> All Javascript response code goes here <% end %>
|
30
40
|
|
31
41
|
=== Example
|
32
42
|
|
@@ -68,4 +78,4 @@ create.js.erb
|
|
68
78
|
|
69
79
|
== Copyright
|
70
80
|
|
71
|
-
Copyright (c)
|
81
|
+
Copyright (c) 2011 Greg Leppert. See LICENSE for details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/lib/remotipart.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Remotipart
|
2
|
-
def remotipart_response(&block)
|
2
|
+
def remotipart_response(options = {}, &block)
|
3
3
|
response.content_type = Mime::HTML
|
4
4
|
content = with_output_buffer(&block)
|
5
|
-
text_area_tag('remotipart_response', String.new(content))
|
5
|
+
text_area_tag('remotipart_response', String.new(content), options)
|
6
6
|
end
|
7
7
|
end
|
8
8
|
|
data/remotipart.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{remotipart}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Greg Leppert"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2011-01-16}
|
13
13
|
s.description = %q{Remotipart is a Ruby on Rails gem enabling remote multipart forms (AJAX style file uploads) with jQuery.
|
14
14
|
This gem augments the native Rails jQuery remote form function enabling asynchronous file uploads with little to no modification to your application.
|
15
15
|
It requires jQuery (http://jquery.com), the Rails jQuery driver (http://github.com/rails/jquery-ujs), and the jQuery Form plugin (http://jquery.malsup.com/form/).
|
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
]
|
22
22
|
s.files = [
|
23
23
|
".document",
|
24
|
+
"History.rdoc",
|
24
25
|
"LICENSE",
|
25
26
|
"README.rdoc",
|
26
27
|
"Rakefile",
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 1
|
9
|
+
version: 0.2.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Greg Leppert
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-01-16 00:00:00 -06:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -41,6 +41,7 @@ extra_rdoc_files:
|
|
41
41
|
- README.rdoc
|
42
42
|
files:
|
43
43
|
- .document
|
44
|
+
- History.rdoc
|
44
45
|
- LICENSE
|
45
46
|
- README.rdoc
|
46
47
|
- Rakefile
|