# Get value back from popup

**URL:** <https://discuss.rubyonrails.org/t/get-value-back-from-popup/173>\
**Category:** rubyonrails-talk\
**Created:** [August 21, 2006, 3:50pm UTC](https://discuss.rubyonrails.org/t/get-value-back-from-popup/173 "2006-08-21T15:50:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lee6](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@Lee6](https://discuss.rubyonrails.org/u/Lee6)\
**Post date:** [August 21, 2006, 3:50pm UTC](https://discuss.rubyonrails.org/t/get-value-back-from-popup/173/1 "2006-08-21T15:50:49Z")

</div>

There is a javascript property called "opener" that refers to the parent window object that opened the child window. That way you can call opener.document.blahblahblah to access forms, or whatever else you need to do. Just google "javascript opener"

---

<div class="post-metadata">

**Author:** ![Michael\_Powers](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Michael\_Powers](https://discuss.rubyonrails.org/u/Michael_Powers)\
**Post date:** [August 30, 2006, 5:42pm UTC](https://discuss.rubyonrails.org/t/get-value-back-from-popup/173/2 "2006-08-30T17:42:29Z")

</div>

I'm using Rails 1.1.6, and I getting some strange error messages when using error\_messages\_for.

Whenever the validation is triggered (by leaving a field blank, for instance), I get this ArgumentError:

&nbsp;&nbsp;&nbsp;wrong number of arguments (2 for 1)

The call to error\_messages\_for looks like this:

&nbsp;&nbsp;&nbsp;1: \<%= error\_messages\_for :link %\> &nbsp;&nbsp;&nbsp;2: &nbsp;&nbsp;&nbsp;3: \<!--[form:link]--\> &nbsp;&nbsp;&nbsp;4: \<p\>\<label for="link\_name"\>Name\</label\>\<br/\>

The application trace is blank, but the framework trace leads to a call to pluralize:

&nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_view/helpers/active\_record\_helper.rb:110:in `pluralize' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/helpers/active_record_helper.rb:110:in `error\_messages\_for' &nbsp;&nbsp;#{RAILS\_ROOT}/vendor/plugins/links/app/views/admin/links/\_form.rhtml:1:in `_run_rhtml __Users_michael_Sites_gingerjargourds46boundingline46com_vendor_plugins_links_app_views_admin_links__ form' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:316:in `compile\_and\_render\_template' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_view/base.rb:292:in `render_template' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:251:in `render\_file' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_view/base.rb:266:in `render' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/partials.rb:59:in `render\_partial' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_controller/benchmarking.rb:33:in `benchmark' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/partials.rb:58:in `render\_partial' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_view/base.rb:278:in `render' &nbsp;&nbsp;#{RAILS_ROOT}/vendor/plugins/links/app/views/admin/links/new.rhtml:2:in `\_run\_rhtml\_\_Users\_michael\_Sites\_gingerjargourds46boundingline46com\_vendor\_plugins\_links\_app\_views\_admin\_links\_new' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_view/base.rb:316:in `compile_and_render_template' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:292:in `render\_template' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_view/base.rb:251:in `render_file' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:726:in `render\_file' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_controller/base.rb:648:in `render_with_no_layout' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:769:in `render\_without\_layout' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_controller/base.rb:718:in `render_action' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:670:in `render\_with\_no\_layout' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_controller/layout.rb:242:in `render_without_benchmark' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:53:in `render' &nbsp;&nbsp;/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:53:in `render' &nbsp;&nbsp;#{RAILS\_ROOT}/vendor/plugins/links/app/controllers/admin/links\_controller.rb:42:in `create' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:941:in `perform\_action\_without\_filters' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_controller/filters.rb:368:in `perform_action_without_benchmark' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in `perform\_action\_without\_rescue' &nbsp;&nbsp;/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in `perform\_action\_without\_rescue' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_controller/rescue.rb:82:in `perform_action' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in `process\_without\_filters' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_controller/filters.rb:377:in `process_without_session_management_support' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:in `process' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in `dispatch' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:150:in `process\_request' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi\_handler.rb:54:in `process!' &nbsp;&nbsp;/usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:600:in `each\_cgi' &nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.8/fcgi.rb:597:in `each_cgi' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:53:in `process!' &nbsp;&nbsp;/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi\_handler.rb:23:in `process!' &nbsp;&nbsp;/Users/michael/Sites/gingerjargourds.boundingline.com/public/dispatch.fcgi:24

Some controllers have this problem, others don't, and I can't figure out what's different about them.

There was a similar question raised in April:

&nbsp;&nbsp;&nbsp;[http://article.gmane.org/gmane.comp.lang.ruby.rails/62380/](http://article.gmane.org/gmane.comp.lang.ruby.rails/62380/)

But it doesn't look like anyone figured this out.

Any ideas?

Thanks,

Michael Powers mpowers1@mac.com

---

<div class="post-metadata">

**Author:** ![Michael\_Powers](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Michael\_Powers](https://discuss.rubyonrails.org/u/Michael_Powers)\
**Post date:** [September 1, 2006, 6:41pm UTC](https://discuss.rubyonrails.org/t/get-value-back-from-popup/173/3 "2006-09-01T18:41:51Z")

</div>

Problem solved. Since at least one other person had the same problem in the past, I'll document it for the message archive.

Problem: I wanted to use singularize in a view, so I put

&nbsp;&nbsp;&nbsp;include Inflector

in the helper file. Side effect: redefining the TextHelper version of pluralize() to be the Inflector (1 argument) version. But error\_messages\_for needs the TextHelper (2 argument) version. Doh!

Removed the include, called singularize() as Inflector.singularize(), and all is well.
