<%= form.label :title, :Title, {:class => 'big'} %>
<%= form.text_field :title, {:class => 'big'} %>
<%= form.label :description %>
<%= form.text_area :description %>
<%= form.label :albums %>
<% for album in @collection.albums %> <% form.fields_for :album_list do |album_fields| %> <% if album.photos.empty? %> <%= album.title %> <% else %> <%= image_tag album.photos.first.path_modified_public('album'), :alt => album.title %> <% end %> <%= album_fields.hidden_field album.id %> <% end %> <% end %>

<% grouped_options = [ ['Available albums',[['Choose album to add','']]], ['Not used', Album.unused.map{|album|[album.title, album.id]} ], ['In use', Album.used.map{|album|[album.title, album.id]} ] ] grouped_options_for_select(grouped_options) %> <%= select_tag 'available_albums', grouped_options_for_select(grouped_options) %>