ActiveAdmin.register Album do

  permit_params :title, :dateCreated, :description, :artist_id, :cover, song_attributes: [:id, :title, :listenURL, :notes, :version, :song_order]

  form(:html => { :multipart => true }) do |f|
    f.inputs do
      f.input :title
      f.input :description, :input_html => { :class => 'tinymce' }
      f.input :artist_id, :label => 'Artist', :as => :select, :collection => Artist.all.map{|u| ["#{u.name}", u.id]}
      f.input :cover, :as => :file
      f.input :cover_cache, :as => :hidden
    end
    f.actions
  end

end

