# Remote\_form\_for not passing element parameters

**URL:** <https://www.ruby-forum.com/t/remote-form-for-not-passing-element-parameters/148880>\
**Category:** Rails\
**Created:** [September 17, 2008, 11:17pm UTC](https://www.ruby-forum.com/t/remote-form-for-not-passing-element-parameters/148880 "2008-09-17T23:17:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![deadinplastic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@deadinplastic](https://www.ruby-forum.com/u/deadinplastic)\
**Post date:** [September 17, 2008, 11:17pm UTC](https://www.ruby-forum.com/t/remote-form-for-not-passing-element-parameters/148880/1 "2008-09-17T23:17:53Z")

</div>

Hi, I am trying to get a remote\_form\_for to work, and I have it  
currently making the request and updating the div etc… but when it  
makes the request it is not passing the value of the collection select  
in the parameters, it is only passing the id, action and controller.  
Hopefully someone can tell me what I’m doing wrong.

Controller Code:

def assign\_job  
job = Job.find(params[:id])  
job.update\_attributes(params[:job])  
@result = ‘Saved!’  
render :partial =\> ‘test’

end

View Code:

```
  <% for job in @jobs %>
    <tr class="<%= cycle('list-line-odd', 'list-line-even') %>">

      <% remote_form_for :job, job,
                             :url => { :action => 'assign_job', :id

```

=\> job },  
:update =\> ‘result\_’ + job.id.to\_s,  
:complete =\> visual\_effect(:highlight,  
‘result’) do |f| %\>

\<%= job.number %\>  
\<%= job.company.name %\>  
\<%= job.passenger\_name %\>  
\<%= job.job\_time.strftime(’%H:%M’) %\>  
\<%= %\>  
\<%= %\>  
\<%= f.collection\_select(:driver\_id, @drivers, :id,  
:company\_name) %\>  
\<%= submit\_tag ‘Save’ %\> 

 \<% end %\> \<% end %\>

---

<div class="post-metadata">

**Author:** ![deadinplastic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@deadinplastic](https://www.ruby-forum.com/u/deadinplastic)\
**Post date:** [September 17, 2008, 11:47pm UTC](https://www.ruby-forum.com/t/remote-form-for-not-passing-element-parameters/148880/2 "2008-09-17T23:47:02Z")

</div>

On Sep 17, 10:17 pm, Ash F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi, I am trying to get a remote\_form\_for to work, and I have it  
> currently making the request and updating the div etc… but when it  
> makes the request it is not passing the value of the collection select  
> in the parameters, it is only passing the id, action and controller.  
> Hopefully someone can tell me what I’m doing wrong.

It would probably help if your html was valid. tr elements can only  
contain th and td tags (those tags can contain forms, or you can have  
forms containing a larger part of the document, but sticking a form  
exactly where you’ve put it isn’t allowed.

Fred

---

<div class="post-metadata">

**Author:** ![deadinplastic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@deadinplastic](https://www.ruby-forum.com/u/deadinplastic)\
**Post date:** [September 18, 2008, 1:58am UTC](https://www.ruby-forum.com/t/remote-form-for-not-passing-element-parameters/148880/3 "2008-09-18T01:58:55Z")

</div>

Thanks, that worked perfectly.
