No commit activity in last 3 years
No release in over 3 years
Responds to parent plugin for Rails 2 and 3
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Rails Responds To Parent plugin¶ ↑

This is a responds to parent plugin that is compatible with rails 2 and rails 3. It is based off the original work by Sean Treadway and has updates from Nicolas Papon. This plugin is available as a ruby gem to aid plugins and applications using bundler to easily resolve dependency issues.

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.html.erb:

<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>

Original sources¶ ↑