Buttons for a drop-down list

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

Feed: feed2
Edit | Back

http://localhost:3000/feeds/show/2

Editing feed

Feed

Category
Show | Back

http://localhost:3000/feeds/edit/1

[email protected] ~/Desktop/strawr $
[email protected] ~/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 %>

[email protected] ~/Desktop/strawr $
[email protected] ~/Desktop/strawr $ tail app/views/feeds/_form.rhtml –
lines=2

Category
<%= select("post", "category_id", Category.find_all.collect {|c| [c.category, c.id]}) %> [email protected] ~/Desktop/strawr $

thanks,

Thufir

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs