# Help with Forms

**URL:** <https://www.ruby-forum.com/t/help-with-forms/159653>\
**Category:** Rails\
**Created:** [February 6, 2009, 6:21pm UTC](https://www.ruby-forum.com/t/help-with-forms/159653 "2009-02-06T18:21:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![frank95a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/87869e/32.png) [@frank95a](https://www.ruby-forum.com/u/frank95a)\
**Post date:** [February 6, 2009, 6:21pm UTC](https://www.ruby-forum.com/t/help-with-forms/159653/1 "2009-02-06T18:21:58Z")

</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| %\>  
\<% form\_for “result” do |f| %\>

  
\<%= f.hidden\_field :product\_id, :value =\> result.id%\> \</  
td\>  
\<%= result.product\_id %\>  
\<%= result.merchant\_id %\>  
\<%= result.price\_am %\> \<%= f.check\_box(result.cool\_ind, options = {}, checked\_value = true, unchecked\_value = false)%\>

```
  <td align="center"><%= link_to "update", :controller =>

```

‘search’, :action =\> ‘update’ %\>

```
    <% 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:** ![frank95a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/87869e/32.png) [@frank95a](https://www.ruby-forum.com/u/frank95a)\
**Post date:** [February 6, 2009, 10:21pm UTC](https://www.ruby-forum.com/t/help-with-forms/159653/2 "2009-02-06T22:21:30Z")

</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:** ![frank95a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/87869e/32.png) [@frank95a](https://www.ruby-forum.com/u/frank95a)\
**Post date:** [February 6, 2009, 10:42pm UTC](https://www.ruby-forum.com/t/help-with-forms/159653/3 "2009-02-06T22:42:00Z")

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

2009/2/6 Jej [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

 |
