Sha256: 02dd46dcbc1554b8b3e7d04d2c74c9055db37f9e292faffc36ce518b02de6a3a

Contents?: true

Size: 849 Bytes

Versions: 49

Compression:

Stored size: 849 Bytes

Contents

RespondsToParent
================

Adds responds_to_parent to your controller to respond to the parent document of your page.
Make Ajaxy file uploads by posting the form to a hidden iframe, and respond with
RJS to the parent window.

Example
=======

Controller:
 
  class Test < ActionController::Base
    def main
    end
 
    def form_action
      # Do stuff with params[:uploaded_file]
        
      responds_to_parent do
        render :update do |page|
          page << "alert($('stuff').innerHTML)"
        end
      end
    end
  end
 
main.rhtml:
 
  <html>
    <body>
      <div id="stuff">Here is some stuff</div>
 
      <form target="frame" action="form_action">
        <input type="file" name="uploaded_file"/>
        <input type="submit"/>
      </form>
 
      <iframe id='frame' name="frame"></iframe>
    </body>
  </html>
  

Version data entries

49 entries across 49 versions & 9 rubygems

Version Path
zena-1.2.8 vendor/plugins/responds_to_parent/README
zena-1.2.7 vendor/plugins/responds_to_parent/README
zena-1.2.6 vendor/plugins/responds_to_parent/README
zena-1.2.5 vendor/plugins/responds_to_parent/README
zena-1.2.4 vendor/plugins/responds_to_parent/README
zena-1.2.3 vendor/plugins/responds_to_parent/README
siwilkins-responds_to_parent-1.0.20121128 README
zena-1.2.2 vendor/plugins/responds_to_parent/README
responds_to_parent-1.1.0 README
responds_to_parent_ffcrm-1.1.0 README
zena-1.2.1 vendor/plugins/responds_to_parent/README
zena-1.2.0 vendor/plugins/responds_to_parent/README
zena-1.1.3 vendor/plugins/responds_to_parent/README
zena-1.1.2 vendor/plugins/responds_to_parent/README
zena-1.1.1 vendor/plugins/responds_to_parent/README
zena-1.1.0 vendor/plugins/responds_to_parent/README
zena-1.0.0 vendor/plugins/responds_to_parent/README
zena-1.0.0.rc3 vendor/plugins/responds_to_parent/README
radiant-paperclipped-extension-0.8.1 vendor/plugins/responds_to_parent/README
zena-1.0.0.rc2 vendor/plugins/responds_to_parent/README