# Help with Forms

**URL:** <https://discuss.rubyonrails.org/t/help-with-forms/39102>\
**Category:** rubyonrails-talk\
**Created:** [February 6, 2009, 5:20pm UTC](https://discuss.rubyonrails.org/t/help-with-forms/39102 "2009-02-06T17:20:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![frank95a](https://avatars.discourse-cdn.com/v4/letter/f/87869e/32.png) [@frank95a](https://discuss.rubyonrails.org/u/frank95a)\
**Post date:** [February 6, 2009, 5:20pm UTC](https://discuss.rubyonrails.org/t/help-with-forms/39102/1 "2009-02-06T17:20:55Z")

</div>

Hello all,

I am a newbie in Rails and have been trying to solve the following by myself for the past 3 days to no avail. Any help is appreciated.

Here is what I am trying to do:

1. Run a search on a table 2. Create a form that will update one attribute per record within the result set

Here is the code:

\<% @search\_result.each do |result| %\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<% form\_for "result" do |f| %\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<tr\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<td\>\<%= f.hidden\_field :product\_id, :value =\> result.id%\> \</

> 

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<td\>\<%= result.product\_id %\>\</td\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<td\>\<%= result.merchant\_id %\>\</td\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<td\>\<%= result.price\_am %\>\</td\> \<td\>\<%= f.check\_box(result.cool\_ind, options = {}, checked\_value = true, unchecked\_value = false)%\>\</td\>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<td align="center"\>\<%= link\_to "update", :controller =\> 'search', :action =\> 'update' %\>\</td\>

\</tr\>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<% end %\>\<% end %\>

However, this is not working at all. The view renders fine. But I am not sure why the id that is passed to the controller is totally out of whack. I have tried the following hash in the controller and it gives me an error that this is nil params[:product][:id]

In addition, it is complaining about the checkbox (i.e. false method passed)

Could any of you tell me what hash to use in the controller?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Jej](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@Jej](https://discuss.rubyonrails.org/u/Jej)\
**Post date:** [February 6, 2009, 9:20pm UTC](https://discuss.rubyonrails.org/t/help-with-forms/39102/2 "2009-02-06T21:20:57Z")

</div>

Maybe a stupid remark: I don't see any submit button in your form...

> However, this is not working at all. The view renders fine. But I am not sure why the id that is passed to the controller is totally out of whack. I have tried the following hash in the controller and it gives me an error that this is nil params[:product][:id]

You should have a look at the server' logs. Find out something like: Parameters: {...} to understand what is sent to the controller.

Jej

---

<div class="post-metadata">

**Author:** ![Colin\_Law1](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@Colin\_Law1](https://discuss.rubyonrails.org/u/Colin_Law1)\
**Post date:** [February 6, 2009, 9:41pm UTC](https://discuss.rubyonrails.org/t/help-with-forms/39102/3 "2009-02-06T21:41:26Z")

</div>

Probably nothing to do with your problem but html does not allow between and though some browsers do not object. It is not allowed between and

|
| |
| either.

 |
