# Form\_remote, getting data from submit

**URL:** <https://www.ruby-forum.com/t/form-remote-getting-data-from-submit/51325>\
**Category:** Rails\
**Created:** [December 29, 2005, 6:11pm UTC](https://www.ruby-forum.com/t/form-remote-getting-data-from-submit/51325 "2005-12-29T18:11:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michiel\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@Michiel\_S](https://www.ruby-forum.com/u/Michiel_S)\
**Post date:** [December 29, 2005, 6:11pm UTC](https://www.ruby-forum.com/t/form-remote-getting-data-from-submit/51325/1 "2005-12-29T18:11:48Z")

</div>

Hi list,

I’m writing a little survey application, and surveys are generated  
dynamically. I use form\_remote\_tag and AJAX to submit the form to a  
method ‘submit’ in my ‘survey’ controller.

The view generates the form as:

 Question 1? Question 2? etc...

How can I access the array/object ‘resultset’ in my submit action in  
the survey controller? I’ve tried using @resultset in the ‘submit’  
view or params[:resultset] in the ‘submit’ action, both seem to be  
nil.

Hope someone can help me.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Michiel\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@Michiel\_S](https://www.ruby-forum.com/u/Michiel_S)\
**Post date:** [December 29, 2005, 6:26pm UTC](https://www.ruby-forum.com/t/form-remote-getting-data-from-submit/51325/2 "2005-12-29T18:26:56Z")

</div>

params[:resultset] is what you want. Try using params[:resultset]  
[‘1’] instead of params[:resultset][1]. (notice the number 1 in quotes)

~ ryan ~

---

<div class="post-metadata">

**Author:** ![Michiel\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@Michiel\_S](https://www.ruby-forum.com/u/Michiel_S)\
**Post date:** [December 29, 2005, 6:42pm UTC](https://www.ruby-forum.com/t/form-remote-getting-data-from-submit/51325/3 "2005-12-29T18:42:03Z")

</div>

2005/12/29, Michiel S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Hope someone can help me.
> 
> Thanks in advance!

Ah, I think I know what the problem is. I should have some resultset  
defined in the ‘show’ method for the view first.

But text\_field etc. work with @object.method, and not with for example  
@array[id]. Is there any way of doing the latter thing?

TIA
