Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

siwilkins-responds_to_parent

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

siwilkins-responds_to_parent

  • 1.0.20121128
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

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:

Here is some stuff
  <form target="frame" action="form_action">
    <input type="file" name="uploaded_file"/>
    <input type="submit"/>
  </form>

  <iframe id='frame' name="frame"></iframe>
</body>

FAQs

Package last updated on 28 Nov 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc