Rails form helpers: how to add an element to a collection?
- by Laran Evans
I have a keychain object. keychain has_many credentials.
I'm trying to write the view code to add a new credential to a keychain. This is the code I have:
<% form_for(@keychain) do |f| %
<tr
<td<%= f.select "credentials[]", current_account.services.collect{ |s|
[s.friendly_name, s.id] }…