Skip to content

Commit

Permalink
Bumped to v1.0. Updated readme and history
Browse files Browse the repository at this point in the history
  • Loading branch information
JangoSteve committed Aug 26, 2011
1 parent 84a1d01 commit a002fde
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 18 deletions.
9 changes: 8 additions & 1 deletion History.rdoc
@@ -1,6 +1,13 @@
= History

=== 0.4.2 / 2011-26-08
=== 1.0 / 2011-08-26

* New Features
* New dependency on simpler jquery.iframe-transport.js (no more form.js)
* New Rack middleware, making `remotipart_response` block obsolete in js.erb responses
* Better support for all requested ajax data-types

=== 0.4.2 / 2011-08-26

* Minor Enhancements
* Updated to jquery.form.js v2.84
Expand Down
65 changes: 49 additions & 16 deletions README.rdoc
@@ -1,9 +1,10 @@
= Remotipart

Remotipart is a Ruby on Rails gem enabling remote multipart forms (AJAX style file uploads) with jQuery.
This gem augments the native Rails jQuery remote form function enabling asynchronous file uploads with little to no modification to your application.
Remotipart is a Ruby on Rails gem enabling AJAX file uploads with jQuery in Rails 3.0 and Rails 3.1 remote forms.
This gem augments the native Rails jQuery remote form functionality enabling asynchronous file uploads with little to no modification to your application.

{View Homepage and Demos}[http://www.alfajango.com/blog/remotipart-rails-gem/]
* {Homepage and Demos}[http://www.alfajango.com/blog/remotipart-rails-gem/]
* {How AJAX File Uploads Work}[http://www.alfajango.com/blog/ajax-file-uploads-with-the-iframe-method/]

== Dependencies

Expand All @@ -12,24 +13,33 @@ This gem augments the native Rails jQuery remote form function enabling asynchro

== Installation

<b>If you're using an old version of the jquery-rails gem,
make sure you have a supported jquery-ujs (rails.js or jquery_ujs.js) version from VERSION_COMPATIBILITY.</b>
<b>Your app should be using jquery-rails gem v1.0.12 or above.</b>

If you're using an old version of the jquery-rails gem,
make sure you have a supported jquery-ujs (rails.js or jquery_ujs.js) version from {VERSION_COMPATIBILITY}[https://github.com/JangoSteve/remotipart/blob/master/VERSION_COMPATIBILITY.rdoc].

[1.]
Install the Remotipart gem

* Add this line to your GEMFILE (add the correct version from previous section if needed)
* Add this line to your GEMFILE (use the appropriate version from the compatibilty chart if needed)

gem 'remotipart', '~> 0.4'
gem 'remotipart', '~> 1.0'

* And run

bundle install

=== Rails 3.1

[2.]
The necessary js files will automatically be added to the asset pipeline, so add the following to app/assets/javascripts/application.js (right after <tt>//= require jquery_ujs</tt>):

//= require jquery.remotipart

=== Rails 3.0

[2.]
Run the Remotipart install generator to add jquery.form.js and jquery.remotipart.js to public/javascripts/
Run the Remotipart install generator to add jquery.iframe-transport.js and jquery.remotipart.js to public/javascripts/

rails g remotipart:install

Expand All @@ -38,13 +48,6 @@ make sure you have a supported jquery-ujs (rails.js or jquery_ujs.js) version fr

<%= javascript_include_tag :defaults %>

=== Rails 3.1

[2.]
The necessary js files will automatically be added to the asset pipeline, so add the following to app/assets/javascripts/application.js (right after <tt>//= require jquery_ujs</tt>):

//= require jquery.remotipart

== Usage

* For multipart / forms with file inputs, set your form_for to remote as you would for a normal ajax form:
Expand Down Expand Up @@ -104,6 +107,36 @@ create.js.erb
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

== Tests

Because of the nature of AJAX file uploads and certain browser restrictions, we could not simply create unit tests (using qunit or jasmine)
to test the file upload functionality of remotipart (since the browsers running those test suites won't allow us to set the target of a file
upload input using javascript). So, instead we created a demo Rails app using remotipart with all remotipart functionality tested using RSpec and Capybara.

* {Demo Rails App with Tests}[https://github.com/JangoSteve/Rails-jQuery-Demo/tree/remotipart]
* {Tests}[https://github.com/JangoSteve/Rails-jQuery-Demo/blob/remotipart/spec/integration/comments_spec.rb]

To run tests:

Clone the remotipart branch of the demo app
git clone -b remotipart git://github.com/JangoSteve/Rails-jQuery-Demo.git

Install the dependencies
bundle install

Run the tests
bundle exec rspec spec/

If you need to test your own changes to remotipart, just update the Gemfile with your own fork/branch of remotipart:

gem 'remotipart', :git => 'git://github.com/MY_FORK/remotipart.git', :branch => 'MY_BRANCH'

== Special Thanks

Thank you to Greg Leppert for writing the original version of this gem and providing inspiration for the gem in its current incarnation.

Thank you to {Adam Kerr}[https://github.com/ajrkerr] for helping move over to the simpler jQuery 1.6-compatible iframe-transport.js and for helping write the rack middleware, making remotipart even easier to use in Rails.

== Copyright

Copyright (c) 2011 Greg Leppert, Steve Schwartz. See LICENSE for details.
Copyright (c) 2011 {Steve Schwartz}[https://github.com/JangoSteve], {Greg Leppert}[https://github.com/leppert]. See LICENSE for details.
2 changes: 1 addition & 1 deletion lib/remotipart/rails/version.rb
@@ -1,6 +1,6 @@
module Remotipart
module Rails
VERSION = "0.4.2"
VERSION = "1.0"
IFRAMETRANSPORT_VERSION = "07.05.2011"
end
end

0 comments on commit a002fde

Please sign in to comment.