Hi,
I'm trying to use collection_select with a habtm
relationship. Let's say
you have two tables: books and authors with a many-to-many
relationship.
Is there any way in rails to render something like selection
boxes for
each author, so that the user can change them?
I tried this (and several more variations) but it doesn't
work:
<% for author in book.authors %>
<%= collection_select("author[]",
"author_id", authors, :id,
:full_name) %>
<% end %>
Is it possible to use collection select for this ?
Thanks in advance,
- Juancho
--
Posted via http://www.ruby-forum.com
/.
_______________________________________________
Rails mailing list
Rails lists.rubyonrails.org
h
ttp://lists.rubyonrails.org/mailman/listinfo/rails
|