I'm working on a way to construct a guest list of an event called a Party. The user_id of each invited guest is stored in a hidden field, separated by spaces.
<%= hidden_field_tag 'guestlist', nil, :class => 'guest_list' %>
When a user invites a new guest, the guest's id is added to the field and stored.
I'm trying to figure out a way so that when a User edits an existing party, the id's of the already invited guests show up in the hidden guest_list field.
Is there a way to do this with embedded Ruby? Something along the lines of:
<% @party.guests.each do |guest| %>
Do something here
<% end %>