Album Basic - Association Radios/Checkboxes

  1. Artist
  2. Tags

  • Settings

    form_attr = {:action=>"/album"}
    form_opts = {:wrapper=>:li, :inputs_wrapper=>:ol, :many=>{:as=>:checkbox}, :one=>{:as=>:radio}, :date=>{}}
    

    Custom CSS

    ol, li {list-style-type: none;}

    Template Code

    <% form(Album.last, form_attr, form_opts) do |f| %>
      <% f.inputs(:legend=>'Album') do %>
        <%= f.input(:name) %>
        <%= f.input(:artist, form_opts[:one]) %>
        <%= f.input(:release_date, form_opts[:date]) %>
        <%= f.input(:release_party_time, form_opts[:date]) %>
        <%= f.input(:copies_sold) %>
        <%= f.input(:debut_album) %>
        <%= f.input(:out_of_print) %>
        <%= f.input(:tags, form_opts[:many]) %>
      <% end %>
      <%= f.button(:value=>'Update Album') %>
    <% end %>