# Buttons for a drop down list

**URL:** <https://www.ruby-forum.com/t/buttons-for-a-drop-down-list/123394>\
**Category:** Rails\
**Created:** [December 17, 2007, 10:42am UTC](https://www.ruby-forum.com/t/buttons-for-a-drop-down-list/123394 "2007-12-17T10:42:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thufir](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Post date:** [December 17, 2007, 10:42am UTC](https://www.ruby-forum.com/t/buttons-for-a-drop-down-list/123394/1 "2007-12-17T10:42:24Z")

</div>

The “show” for a row from feeds works correctly, showing both rows which  
that feed row. However, I’d like to add a “add” button (and a  
“remove”?)  
to the “Editing feed” page so that the the rows from categories will be  
associated/unassociated with that feeds row.

(There’s a many-to-many relationship between “feeds” and “categories”.)

Feed: feed1  
Edit | Back  
Itemized Categories  
cat1  
category2

[http://localhost:3000/feeds/show/1](http://localhost:3000/feeds/show/1)

Feed: feed2  
Edit | Back

[http://localhost:3000/feeds/show/2](http://localhost:3000/feeds/show/2)

Editing feed

Feed

Category  
Show | Back

[http://localhost:3000/feeds/edit/1](http://localhost:3000/feeds/edit/1)

thufir@arrakis ~/Desktop/strawr $  
thufir@arrakis ~/Desktop/strawr $ tail app/views/feeds/show.rhtml –  
lines=13

\<% if @feed.has\_categories? %\>

### Itemized Categories
 \<% for category in @feed.categories %\> \<% end %\> 

| \<%= category.category %\> |

\<% end %\>

thufir@arrakis ~/Desktop/strawr $  
thufir@arrakis ~/Desktop/strawr $ tail app/views/feeds/\_form.rhtml –  
lines=2

Category  
\<%= select("post", "category\_id", Category.find\_all.collect {|c| [c.category, c.id]}) %\>

thufir@arrakis ~/Desktop/strawr $

thanks,

Thufir
