# Help with form remote tag and select name from list

**URL:** <https://www.ruby-forum.com/t/help-with-form-remote-tag-and-select-name-from-list/125408>\
**Category:** Rails\
**Created:** [January 8, 2008, 10:01pm UTC](https://www.ruby-forum.com/t/help-with-form-remote-tag-and-select-name-from-list/125408 "2008-01-08T22:01:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [January 8, 2008, 10:01pm UTC](https://www.ruby-forum.com/t/help-with-form-remote-tag-and-select-name-from-list/125408/1 "2008-01-08T22:01:29Z")

</div>

I have this code:

```
    <b>Repuestos</b><br />

```

 \<% @rp\_parts.each do |rp\_part| %\> \> \<%= rp\_part.name%\> \<% end %\> 

\<% form\_remote\_tag :url =\> { :action =\> :add\_to\_repair, :id =\>  
@repair\_ticket.id, :aaaa =\> @repair\_ticket.rp\_item } do %\>  
\<%= submit\_tag “Add repair\_part” %\>  
\<% end %\>

I don’t know how to send the rp\_part.name from :aaaa. Is is possible  
outside a form like the form in new.rhtml?

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [January 9, 2008, 2:21am UTC](https://www.ruby-forum.com/t/help-with-form-remote-tag-and-select-name-from-list/125408/2 "2008-01-09T02:21:31Z")

</div>

Hi John,  
I was originally going to try and correct your code, but perhaps a  
sample app is easier  
Please download from [http://www.authomedia.co.uk/dev/repairs.zip](http://www.authomedia.co.uk/dev/repairs.zip) and  
see how you get on. The models might not be quite what you have, but  
it shows a simple RESTful controller setup with a HABTM join table and  
AJAX create/destroy associations.

Should put you back on track

Joe

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [January 9, 2008, 8:59am UTC](https://www.ruby-forum.com/t/help-with-form-remote-tag-and-select-name-from-list/125408/3 "2008-01-09T08:59:57Z")

</div>

Wildtangent wrote:

> Hi John,  
> I was originally going to try and correct your code, but perhaps a  
> sample app is easier  
> Please download from [http://www.authomedia.co.uk/dev/repairs.zip](http://www.authomedia.co.uk/dev/repairs.zip) and  
> see how you get on. The models might not be quite what you have, but  
> it shows a simple RESTful controller setup with a HABTM join table and  
> AJAX create/destroy associations.
> 
> Should put you back on track
> 
> Joe

Ok, thrank you very much. I think this simple app will be very helpful  
and will be the new base for my project. Anyway, does anybody know if I  
can do something with my code? For now on, I only want to know it in  
order to gain experience.
